diff --git a/README.md b/README.md index 0609434469..baa31d2422 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ First, finetune: ```python # import our libraries import flash -from flash import download_data +from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. Download the data @@ -170,7 +170,7 @@ Flash has an Image embedding task to encodes an image into a vector of image fea View example ```python -from flash.core.data import download_data +from flash.data.utils import download_data from flash.vision import ImageEmbedder # 1. Download the data @@ -197,7 +197,7 @@ Flash has a Summarization task to sum up text from a larger article into a short ```python # import our libraries import flash -from flash import download_data +from flash.data.utils import download_data from flash.text import SummarizationData, SummarizationTask # 1. Download the data @@ -244,7 +244,7 @@ To illustrate, say we want to build a model to predict if a passenger survived o # import our libraries from torchmetrics.classification import Accuracy, Precision, Recall import flash -from flash import download_data +from flash.data.utils import download_data from flash.tabular import TabularClassifier, TabularData # 1. Download the data @@ -295,7 +295,7 @@ To illustrate, say we want to build a model on a tiny coco dataset. ```python # import our libraries import flash -from flash.core.data import download_data +from flash.data.utils import download_data from flash.vision import ObjectDetectionData, ObjectDetector # 1. Download the data diff --git a/docs/source/general/finetuning.rst b/docs/source/general/finetuning.rst index bdafca6360..a2b1cb95e1 100644 --- a/docs/source/general/finetuning.rst +++ b/docs/source/general/finetuning.rst @@ -52,7 +52,7 @@ Here are the steps in code .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. download and organize the data diff --git a/docs/source/general/predictions.rst b/docs/source/general/predictions.rst index a2214c74ba..76ca94511d 100644 --- a/docs/source/general/predictions.rst +++ b/docs/source/general/predictions.rst @@ -12,11 +12,11 @@ Predict on a single sample of data You can pass in a sample of data (image file path, a string of text, etc) to the :func:`~flash.core.model.Task.predict` method. - + .. code-block:: python from flash import Trainer - from flash.core.data import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier @@ -37,7 +37,7 @@ Predict on a csv file .. code-block:: python - from flash.core.data import download_data + from flash.data.utils import download_data from flash.tabular import TabularClassifier # 1. Download the data @@ -51,5 +51,3 @@ Predict on a csv file # 3. Generate predictions from a csv file! Who would survive? predictions = model.predict("data/titanic/titanic.csv") print(predictions) - - diff --git a/docs/source/general/training.rst b/docs/source/general/training.rst index 67149bf742..aa1e3ec6ae 100644 --- a/docs/source/general/training.rst +++ b/docs/source/general/training.rst @@ -11,7 +11,7 @@ Some Flash tasks have been pretrained on large data sets. To accelerate your tra .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. download and organize the data @@ -48,7 +48,7 @@ Flash tasks supports many advanced training functionalities out-of-the-box, such # train on 1 GPU flash.Trainer(gpus=1) - + * Training on multiple GPUs .. code-block:: python @@ -60,7 +60,7 @@ Flash tasks supports many advanced training functionalities out-of-the-box, such # train on gpu 1, 3, 5 (3 gpus total) flash.Trainer(gpus=[1, 3, 5]) - + * Using mixed precision training .. code-block:: python diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index f30f4ec7eb..1614315f50 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -15,7 +15,7 @@ For getting started with Deep Learning Easy to learn ^^^^^^^^^^^^^ -If you are just getting started with deep learning, Flash offers common deep learning tasks you can use out-of-the-box in a few lines of code, no math, fancy nn.Modules or research experience required! +If you are just getting started with deep learning, Flash offers common deep learning tasks you can use out-of-the-box in a few lines of code, no math, fancy nn.Modules or research experience required! Easy to scale ^^^^^^^^^^^^^ @@ -70,7 +70,7 @@ You can install flash using pip or conda: Tasks ===== -Flash is comprised of a collection of Tasks. The Flash tasks are laser-focused objects designed to solve a well-defined type of problem, using state-of-the-art methods. +Flash is comprised of a collection of Tasks. The Flash tasks are laser-focused objects designed to solve a well-defined type of problem, using state-of-the-art methods. The Flash tasks contain all the relevant information to solve the task at hand- the number of class labels you want to predict, number of columns in your dataset, as well as details on the model architecture used such as loss function, optimizers, etc. @@ -137,7 +137,7 @@ Here's an example of finetuning. .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. Download the data diff --git a/docs/source/reference/image_classification.rst b/docs/source/reference/image_classification.rst index c457be23c6..ce5cee4a48 100644 --- a/docs/source/reference/image_classification.rst +++ b/docs/source/reference/image_classification.rst @@ -25,7 +25,7 @@ Use the :class:`~flash.vision.ImageClassifier` pretrained model for inference on # import our libraries from flash import Trainer - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. Download the data @@ -90,7 +90,7 @@ Now all we need is three lines of code to build to train our task! .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageClassifier # 1. Download the data diff --git a/docs/source/reference/image_embedder.rst b/docs/source/reference/image_embedder.rst index f2c2b2b36f..3696af4da6 100644 --- a/docs/source/reference/image_embedder.rst +++ b/docs/source/reference/image_embedder.rst @@ -54,7 +54,7 @@ To tailor this image embedder to your dataset, finetune first. .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.vision import ImageClassificationData, ImageEmbedder # 1. Download the data diff --git a/docs/source/reference/object_detection.rst b/docs/source/reference/object_detection.rst index bed0c9fd53..d6cd1e1c91 100644 --- a/docs/source/reference/object_detection.rst +++ b/docs/source/reference/object_detection.rst @@ -75,7 +75,7 @@ To tailor the object detector to your dataset, you would need to have it in `COC .. code-block:: python import flash - from flash.core.data import download_data + from flash.data.utils import download_data from flash.vision import ObjectDetectionData, ObjectDetector # 1. Download the data diff --git a/docs/source/reference/summarization.rst b/docs/source/reference/summarization.rst index 5f47542b2e..bfa389ba9a 100644 --- a/docs/source/reference/summarization.rst +++ b/docs/source/reference/summarization.rst @@ -60,7 +60,7 @@ Or on a given dataset, use :class:`~flash.core.trainer.Trainer` `predict` method # import our libraries from flash import Trainer - from flash import download_data + from flash.data.utils import download_data from flash.text import SummarizationData, SummarizationTask # 1. Download data @@ -104,7 +104,7 @@ All we need is three lines of code to train our model! # import our libraries import flash - from flash import download_data + from flash.data.utils import download_data from flash.text import SummarizationData, SummarizationTask # 1. Download data diff --git a/docs/source/reference/tabular_classification.rst b/docs/source/reference/tabular_classification.rst index 8952ffa1eb..e54356c751 100644 --- a/docs/source/reference/tabular_classification.rst +++ b/docs/source/reference/tabular_classification.rst @@ -45,7 +45,7 @@ Next, we create the :class:`~flash.tabular.TabularClassifier` task, using the Da .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.tabular import TabularClassifier, TabularData from torchmetrics.classification import Accuracy, Precision, Recall @@ -92,7 +92,7 @@ You can make predcitions on a pretrained model, that has already been trained fo .. code-block:: python - from flash.core.data import download_data + from flash.data.utils import download_data from flash.tabular import TabularClassifier # 1. Download the data @@ -113,7 +113,7 @@ Or you can finetune your own model and use that for prediction: .. code-block:: python import flash - from flash import download_data + from flash.data.utils import download_data from flash.tabular import TabularClassifier, TabularData # 1. Load the data diff --git a/docs/source/reference/text_classification.rst b/docs/source/reference/text_classification.rst index c68fa925b7..e821af7e0d 100644 --- a/docs/source/reference/text_classification.rst +++ b/docs/source/reference/text_classification.rst @@ -24,7 +24,7 @@ Use the :class:`~flash.text.classification.model.TextClassifier` pretrained mode from pytorch_lightning import Trainer - from flash import download_data + from flash.data.utils import download_data from flash.text import TextClassificationData, TextClassifier @@ -77,7 +77,7 @@ All we need is three lines of code to train our model! .. code-block:: python import flash - from flash.core.data import download_data + from flash.data.utils import download_data from flash.text import TextClassificationData, TextClassifier # 1. Download the data diff --git a/docs/source/reference/translation.rst b/docs/source/reference/translation.rst index cdcd07db01..05ee877deb 100644 --- a/docs/source/reference/translation.rst +++ b/docs/source/reference/translation.rst @@ -42,7 +42,7 @@ Or on a given dataset, use :class:`~flash.core.trainer.Trainer` `predict` method # import our libraries from flash import Trainer - from flash import download_data + from flash.data.utils import download_data from flash.text import TranslationData, TranslationTask # 1. Download data @@ -86,7 +86,7 @@ All we need is three lines of code to train our model! By default, we use a `mBA # import our libraries import flash - from flash import download_data + from flash.data.utils import download_data from flash.text import TranslationData, TranslationTask # 1. Download data diff --git a/flash_examples/finetuning/summarization.py b/flash_examples/finetuning/summarization.py index 08e3f63f4b..d2ecc726f3 100644 --- a/flash_examples/finetuning/summarization.py +++ b/flash_examples/finetuning/summarization.py @@ -13,8 +13,8 @@ # limitations under the License. import torch -import flash -from flash import download_data, Trainer +from flash import Trainer +from flash.data.utils import download_data from flash.text import SummarizationData, SummarizationTask # 1. Download the data @@ -33,7 +33,7 @@ model = SummarizationTask() # 4. Create the trainer. Run once on data -trainer = flash.Trainer(gpus=int(torch.cuda.is_available()), fast_dev_run=True) +trainer = Trainer(gpus=int(torch.cuda.is_available()), fast_dev_run=True) # 5. Fine-tune the model trainer.finetune(model, datamodule=datamodule) diff --git a/flash_examples/finetuning/translation.py b/flash_examples/finetuning/translation.py index fe3e0a3f24..be91ea057d 100644 --- a/flash_examples/finetuning/translation.py +++ b/flash_examples/finetuning/translation.py @@ -14,7 +14,7 @@ import torch import flash -from flash import download_data +from flash.data.utils import download_data from flash.text import TranslationData, TranslationTask # 1. Download the data diff --git a/flash_examples/predict/translation.py b/flash_examples/predict/translation.py index a956a4af5a..bbf3d42446 100644 --- a/flash_examples/predict/translation.py +++ b/flash_examples/predict/translation.py @@ -13,7 +13,7 @@ # limitations under the License. from pytorch_lightning import Trainer -from flash import download_data +from flash.data.utils import download_data from flash.text import TranslationData, TranslationTask # 1. Download the data