We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
TabularForecastingData must include predict_data_frame
## 📚 Documentation

The [NBEATS tutorial](https://lightning-flash.readthedocs.io/en/stable/notebooks/flash_tutorials/electricity_forecasting.html) uses `0.5.x`, which references `model.predict()` at the end to generate predictions. In `0.6.0`, `model.predict()` was deprecated in favor of `trainer.predict(model, datamodule=datamodule)`.

If you try to do this by passing the `datamodule` created via:

```python
datamodule = TabularForecastingData.from_data_frame(
    time_idx="time_idx",
    target="price actual",
    group_ids=["constant"],
    max_encoder_length=max_encoder_length,
    max_prediction_length=max_prediction_length,
    time_varying_unknown_reals=["price actual"],
    train_data_frame=df_energy_daily[df_energy_daily["time_idx"] <= training_cutoff],
    val_data_frame=df_energy_daily,
    batch_size=256,
)
```

to `trainer.predict(...)`, you'll get the following error:

```python
MisconfigurationException: No `predict_dataloader()` method defined to run `Trainer.predict`.
```

The solution is to be found [here](https://lightning-flash.readthedocs.io/en/stable/reference/tabular_forecasting.html), which clearly shows how to make the prediction datamodule:

```python
# 4. Generate predictions
datamodule = TabularForecastingData.from_data_frame(predict_data_frame=data, parameters=datamodule.parameters)
predictions = trainer.predict(model, datamodule=datamodule)
```

__Suggestion:__
* Update the tutorial to use `0.6.0`
* Add a small section to the [API docs](https://lightning-flash.readthedocs.io/en/stable/api/generated/flash.tabular.forecasting.data.TabularForecastingData.html#flash.tabular.forecasting.data.TabularForecastingData.from_data_frame) explaining that `predict_data_frame` must be specified in order to make use of `trainer.predict(...)` 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/source/conf.py`
Content:
```
1 # Configuration file for the Sphinx documentation builder.
2 #
3 # This file only contains a selection of the most common options. For a full
4 # list see the documentation:
5 # https://www.sphinx-doc.org/en/master/usage/configuration.html
6 
7 # -- Path setup --------------------------------------------------------------
8 
9 # If extensions (or modules to document with autodoc) are in another directory,
10 # add these directories to sys.path here. If the directory is relative to the
11 # documentation root, use os.path.abspath to make it absolute, like shown here.
12 #
13 import glob
14 import os
15 import shutil
16 import sys
17 import warnings
18 from importlib.util import module_from_spec, spec_from_file_location
19 
20 import pt_lightning_sphinx_theme
21 
22 _PATH_HERE = os.path.abspath(os.path.dirname(__file__))
23 _PATH_ROOT = os.path.join(_PATH_HERE, "..", "..")
24 _PATH_RAW_NB = os.path.join(_PATH_ROOT, "_notebooks")
25 sys.path.insert(0, os.path.abspath(_PATH_ROOT))
26 sys.path.append(os.path.join(_PATH_RAW_NB, ".actions"))
27 
28 _SHOULD_COPY_NOTEBOOKS = True
29 
30 try:
31     from helpers import HelperCLI
32 except Exception:
33     _SHOULD_COPY_NOTEBOOKS = False
34     warnings.warn("To build the code, please run: `git submodule update --init --recursive`", stacklevel=2)
35 
36 
37 def _load_py_module(fname, pkg="flash"):
38     spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))
39     py = module_from_spec(spec)
40     spec.loader.exec_module(py)
41     return py
42 
43 
44 try:
45     from flash import __about__ as about
46     from flash.core.utilities import providers
47 
48 except ModuleNotFoundError:
49 
50     about = _load_py_module("__about__.py")
51     providers = _load_py_module("core/utilities/providers.py")
52 
53 SPHINX_MOCK_REQUIREMENTS = int(os.environ.get("SPHINX_MOCK_REQUIREMENTS", True))
54 
55 html_favicon = "_static/images/icon.svg"
56 
57 # -- Project information -----------------------------------------------------
58 
59 project = "Flash"
60 copyright = "2020-2021, PyTorch Lightning"
61 author = "PyTorch Lightning"
62 
63 # -- Project documents -------------------------------------------------------
64 if _SHOULD_COPY_NOTEBOOKS:
65     HelperCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, "notebooks", patterns=["flash_tutorials"])
66 
67 
68 def _transform_changelog(path_in: str, path_out: str) -> None:
69     with open(path_in) as fp:
70         chlog_lines = fp.readlines()
71     # enrich short subsub-titles to be unique
72     chlog_ver = ""
73     for i, ln in enumerate(chlog_lines):
74         if ln.startswith("## "):
75             chlog_ver = ln[2:].split("-")[0].strip()
76         elif ln.startswith("### "):
77             ln = ln.replace("###", f"### {chlog_ver} -")
78             chlog_lines[i] = ln
79     with open(path_out, "w") as fp:
80         fp.writelines(chlog_lines)
81 
82 
83 generated_dir = os.path.join(_PATH_HERE, "generated")
84 
85 os.makedirs(generated_dir, exist_ok=True)
86 # copy all documents from GH templates like contribution guide
87 for md in glob.glob(os.path.join(_PATH_ROOT, ".github", "*.md")):
88     shutil.copy(md, os.path.join(generated_dir, os.path.basename(md)))
89 # copy also the changelog
90 _transform_changelog(os.path.join(_PATH_ROOT, "CHANGELOG.md"), os.path.join(generated_dir, "CHANGELOG.md"))
91 
92 # -- Generate providers ------------------------------------------------------
93 
94 lines = []
95 for provider in providers.PROVIDERS:
96     lines.append(f"- {str(provider)}\n")
97 
98 generated_dir = os.path.join("integrations", "generated")
99 os.makedirs(generated_dir, exist_ok=True)
100 
101 with open(os.path.join(generated_dir, "providers.rst"), "w") as f:
102     f.writelines(sorted(lines, key=str.casefold))
103 
104 # -- General configuration ---------------------------------------------------
105 
106 # Add any Sphinx extension module names here, as strings. They can be
107 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
108 # ones.
109 extensions = [
110     "sphinx.ext.autodoc",
111     "sphinx.ext.doctest",
112     "sphinx.ext.intersphinx",
113     "sphinx.ext.todo",
114     "sphinx.ext.viewcode",
115     "sphinx.ext.autosummary",
116     "sphinx.ext.napoleon",
117     "sphinx.ext.imgmath",
118     "myst_parser",
119     "nbsphinx",
120     "sphinx_autodoc_typehints",
121     "sphinx_copybutton",
122     "sphinx_paramlinks",
123     "sphinx_togglebutton",
124     "pt_lightning_sphinx_theme.extensions.lightning_tutorials",
125 ]
126 
127 # autodoc: Default to members and undoc-members
128 autodoc_default_options = {"members": True}
129 
130 # autodoc: Don't inherit docstrings (e.g. for nn.Module.forward)
131 autodoc_inherit_docstrings = False
132 
133 # Add any paths that contain templates here, relative to this directory.
134 templates_path = ["_templates"]
135 
136 # https://berkeley-stat159-f17.github.io/stat159-f17/lectures/14-sphinx..html#conf.py-(cont.)
137 # https://stackoverflow.com/questions/38526888/embed-ipython-notebook-in-sphinx-document
138 # I execute the notebooks manually in advance. If notebooks test the code,
139 # they should be run at build time.
140 nbsphinx_execute = "never"
141 nbsphinx_allow_errors = True
142 nbsphinx_requirejs_path = ""
143 
144 # List of patterns, relative to source directory, that match files and
145 # directories to ignore when looking for source files.
146 # This pattern also affects html_static_path and html_extra_path.
147 exclude_patterns = ["generated/PULL_REQUEST_TEMPLATE.md"]
148 
149 # myst-parser, forcing to parse all html pages with mathjax
150 # https://github.com/executablebooks/MyST-Parser/issues/394
151 myst_update_mathjax = False
152 
153 # The suffix(es) of source filenames.
154 # You can specify multiple suffix as a list of string:
155 #
156 source_parsers = {".rst": "restructuredtext", ".txt": "markdown", ".md": "markdown", ".ipynb": "nbsphinx"}
157 
158 # The master toctree document.
159 master_doc = "index"
160 
161 needs_sphinx = "4.0"
162 
163 # -- Options for intersphinx extension ---------------------------------------
164 
165 # Example configuration for intersphinx: refer to the Python standard library.
166 intersphinx_mapping = {
167     "python": ("https://docs.python.org/3", None),
168     "torch": ("https://pytorch.org/docs/stable/", None),
169     "numpy": ("https://numpy.org/doc/stable/", None),
170     "PIL": ("https://pillow.readthedocs.io/en/stable/", None),
171     "pytorchvideo": ("https://pytorchvideo.readthedocs.io/en/latest/", None),
172     "pytorch_lightning": ("https://pytorch-lightning.readthedocs.io/en/stable/", None),
173     "fiftyone": ("https://voxel51.com/docs/fiftyone/", "fiftyone_objects.inv"),
174 }
175 
176 # -- Options for HTML output -------------------------------------------------
177 
178 # The theme to use for HTML and HTML Help pages.  See the documentation for
179 # a list of builtin themes.
180 #
181 html_theme = "pt_lightning_sphinx_theme"
182 html_theme_path = [pt_lightning_sphinx_theme.get_html_theme_path()]
183 
184 # Theme options are theme-specific and customize the look and feel of a theme
185 # further.  For a list of options available for each theme, see the
186 # documentation.
187 
188 html_theme_options = {
189     "pytorch_project": "https://pytorchlightning.ai",
190     "canonical_url": about.__docs_url__,
191     "collapse_navigation": False,
192     "display_version": True,
193     "logo_only": False,
194 }
195 
196 # Add any paths that contain custom static files (such as style sheets) here,
197 # relative to this directory. They are copied after the builtin static files,
198 # so a file named "default.css" will overwrite the builtin "default.css".
199 html_static_path = ["_static"]
200 
201 html_css_files = []
202 
203 
204 def setup(app):
205     # this is for hiding doctest decoration,
206     # see: http://z4r.github.io/python/2011/12/02/hides-the-prompts-and-output/
207     app.add_js_file("copybutton.js")
208     app.add_css_file("main.css")
209 
210 
211 # Ignoring Third-party packages
212 # https://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule
213 def _package_list_from_file(pfile):
214     assert os.path.isfile(pfile)
215     with open(pfile) as fp:
216         lines = fp.readlines()
217     list_pkgs = []
218     for ln in lines:
219         found = [ln.index(ch) for ch in list(",=<>#@") if ch in ln]
220         pkg = ln[: min(found)] if found else ln
221         if pkg.strip():
222             list_pkgs.append(pkg.strip())
223     return list_pkgs
224 
225 
226 # define mapping from PyPI names to python imports
227 PACKAGE_MAPPING = {
228     "pytorch-lightning": "pytorch_lightning",
229     "scikit-learn": "sklearn",
230     "Pillow": "PIL",
231     "PyYAML": "yaml",
232     "rouge-score": "rouge_score",
233     "lightning-bolts": "pl_bolts",
234     "pytorch-tabnet": "pytorch_tabnet",
235     "pyDeprecate": "deprecate",
236 }
237 MOCK_PACKAGES = ["numpy", "PyYAML", "tqdm"]
238 if SPHINX_MOCK_REQUIREMENTS:
239     # mock also base packages when we are on RTD since we don't install them there
240     MOCK_PACKAGES += _package_list_from_file(os.path.join(_PATH_ROOT, "requirements.txt"))
241 # replace PyPI packages by importing ones
242 MOCK_PACKAGES = [PACKAGE_MAPPING.get(pkg, pkg) for pkg in MOCK_PACKAGES]
243 
244 autodoc_mock_imports = MOCK_PACKAGES
245 
246 # only run doctests marked with a ".. doctest::" directive
247 doctest_test_doctest_blocks = ""
248 doctest_global_setup = """
249 import torch
250 import pytorch_lightning as pl
251 import flash
252 """
253
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -28,7 +28,7 @@
 _SHOULD_COPY_NOTEBOOKS = True
 
 try:
-    from helpers import HelperCLI
+    from assistant import AssistantCLI
 except Exception:
     _SHOULD_COPY_NOTEBOOKS = False
     warnings.warn("To build the code, please run: `git submodule update --init --recursive`", stacklevel=2)
@@ -62,7 +62,7 @@
 
 # -- Project documents -------------------------------------------------------
 if _SHOULD_COPY_NOTEBOOKS:
-    HelperCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, "notebooks", patterns=["flash_tutorials"])
+    AssistantCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, "notebooks", patterns=["flash_tutorials"])
 
 
 def _transform_changelog(path_in: str, path_out: str) -> None:

{"golden_diff": "diff --git a/docs/source/conf.py b/docs/source/conf.py\n--- a/docs/source/conf.py\n+++ b/docs/source/conf.py\n@@ -28,7 +28,7 @@\n _SHOULD_COPY_NOTEBOOKS = True\n \n try:\n-    from helpers import HelperCLI\n+    from assistant import AssistantCLI\n except Exception:\n     _SHOULD_COPY_NOTEBOOKS = False\n     warnings.warn(\"To build the code, please run: `git submodule update --init --recursive`\", stacklevel=2)\n@@ -62,7 +62,7 @@\n \n # -- Project documents -------------------------------------------------------\n if _SHOULD_COPY_NOTEBOOKS:\n-    HelperCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, \"notebooks\", patterns=[\"flash_tutorials\"])\n+    AssistantCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, \"notebooks\", patterns=[\"flash_tutorials\"])\n \n \n def _transform_changelog(path_in: str, path_out: str) -> None:\n", "issue": "TabularForecastingData must include predict_data_frame\n## \ud83d\udcda Documentation\r\n\r\nThe [NBEATS tutorial](https://lightning-flash.readthedocs.io/en/stable/notebooks/flash_tutorials/electricity_forecasting.html) uses `0.5.x`, which references `model.predict()` at the end to generate predictions. In `0.6.0`, `model.predict()` was deprecated in favor of `trainer.predict(model, datamodule=datamodule)`.\r\n\r\nIf you try to do this by passing the `datamodule` created via:\r\n\r\n```python\r\ndatamodule = TabularForecastingData.from_data_frame(\r\n    time_idx=\"time_idx\",\r\n    target=\"price actual\",\r\n    group_ids=[\"constant\"],\r\n    max_encoder_length=max_encoder_length,\r\n    max_prediction_length=max_prediction_length,\r\n    time_varying_unknown_reals=[\"price actual\"],\r\n    train_data_frame=df_energy_daily[df_energy_daily[\"time_idx\"] <= training_cutoff],\r\n    val_data_frame=df_energy_daily,\r\n    batch_size=256,\r\n)\r\n```\r\n\r\nto `trainer.predict(...)`, you'll get the following error:\r\n\r\n```python\r\nMisconfigurationException: No `predict_dataloader()` method defined to run `Trainer.predict`.\r\n```\r\n\r\nThe solution is to be found [here](https://lightning-flash.readthedocs.io/en/stable/reference/tabular_forecasting.html), which clearly shows how to make the prediction datamodule:\r\n\r\n```python\r\n# 4. Generate predictions\r\ndatamodule = TabularForecastingData.from_data_frame(predict_data_frame=data, parameters=datamodule.parameters)\r\npredictions = trainer.predict(model, datamodule=datamodule)\r\n```\r\n\r\n__Suggestion:__\r\n* Update the tutorial to use `0.6.0`\r\n* Add a small section to the [API docs](https://lightning-flash.readthedocs.io/en/stable/api/generated/flash.tabular.forecasting.data.TabularForecastingData.html#flash.tabular.forecasting.data.TabularForecastingData.from_data_frame) explaining that `predict_data_frame` must be specified in order to make use of `trainer.predict(...)` \n", "before_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Path setup --------------------------------------------------------------\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\nimport glob\nimport os\nimport shutil\nimport sys\nimport warnings\nfrom importlib.util import module_from_spec, spec_from_file_location\n\nimport pt_lightning_sphinx_theme\n\n_PATH_HERE = os.path.abspath(os.path.dirname(__file__))\n_PATH_ROOT = os.path.join(_PATH_HERE, \"..\", \"..\")\n_PATH_RAW_NB = os.path.join(_PATH_ROOT, \"_notebooks\")\nsys.path.insert(0, os.path.abspath(_PATH_ROOT))\nsys.path.append(os.path.join(_PATH_RAW_NB, \".actions\"))\n\n_SHOULD_COPY_NOTEBOOKS = True\n\ntry:\n    from helpers import HelperCLI\nexcept Exception:\n    _SHOULD_COPY_NOTEBOOKS = False\n    warnings.warn(\"To build the code, please run: `git submodule update --init --recursive`\", stacklevel=2)\n\n\ndef _load_py_module(fname, pkg=\"flash\"):\n    spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))\n    py = module_from_spec(spec)\n    spec.loader.exec_module(py)\n    return py\n\n\ntry:\n    from flash import __about__ as about\n    from flash.core.utilities import providers\n\nexcept ModuleNotFoundError:\n\n    about = _load_py_module(\"__about__.py\")\n    providers = _load_py_module(\"core/utilities/providers.py\")\n\nSPHINX_MOCK_REQUIREMENTS = int(os.environ.get(\"SPHINX_MOCK_REQUIREMENTS\", True))\n\nhtml_favicon = \"_static/images/icon.svg\"\n\n# -- Project information -----------------------------------------------------\n\nproject = \"Flash\"\ncopyright = \"2020-2021, PyTorch Lightning\"\nauthor = \"PyTorch Lightning\"\n\n# -- Project documents -------------------------------------------------------\nif _SHOULD_COPY_NOTEBOOKS:\n    HelperCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, \"notebooks\", patterns=[\"flash_tutorials\"])\n\n\ndef _transform_changelog(path_in: str, path_out: str) -> None:\n    with open(path_in) as fp:\n        chlog_lines = fp.readlines()\n    # enrich short subsub-titles to be unique\n    chlog_ver = \"\"\n    for i, ln in enumerate(chlog_lines):\n        if ln.startswith(\"## \"):\n            chlog_ver = ln[2:].split(\"-\")[0].strip()\n        elif ln.startswith(\"### \"):\n            ln = ln.replace(\"###\", f\"### {chlog_ver} -\")\n            chlog_lines[i] = ln\n    with open(path_out, \"w\") as fp:\n        fp.writelines(chlog_lines)\n\n\ngenerated_dir = os.path.join(_PATH_HERE, \"generated\")\n\nos.makedirs(generated_dir, exist_ok=True)\n# copy all documents from GH templates like contribution guide\nfor md in glob.glob(os.path.join(_PATH_ROOT, \".github\", \"*.md\")):\n    shutil.copy(md, os.path.join(generated_dir, os.path.basename(md)))\n# copy also the changelog\n_transform_changelog(os.path.join(_PATH_ROOT, \"CHANGELOG.md\"), os.path.join(generated_dir, \"CHANGELOG.md\"))\n\n# -- Generate providers ------------------------------------------------------\n\nlines = []\nfor provider in providers.PROVIDERS:\n    lines.append(f\"- {str(provider)}\\n\")\n\ngenerated_dir = os.path.join(\"integrations\", \"generated\")\nos.makedirs(generated_dir, exist_ok=True)\n\nwith open(os.path.join(generated_dir, \"providers.rst\"), \"w\") as f:\n    f.writelines(sorted(lines, key=str.casefold))\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.doctest\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.todo\",\n    \"sphinx.ext.viewcode\",\n    \"sphinx.ext.autosummary\",\n    \"sphinx.ext.napoleon\",\n    \"sphinx.ext.imgmath\",\n    \"myst_parser\",\n    \"nbsphinx\",\n    \"sphinx_autodoc_typehints\",\n    \"sphinx_copybutton\",\n    \"sphinx_paramlinks\",\n    \"sphinx_togglebutton\",\n    \"pt_lightning_sphinx_theme.extensions.lightning_tutorials\",\n]\n\n# autodoc: Default to members and undoc-members\nautodoc_default_options = {\"members\": True}\n\n# autodoc: Don't inherit docstrings (e.g. for nn.Module.forward)\nautodoc_inherit_docstrings = False\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# https://berkeley-stat159-f17.github.io/stat159-f17/lectures/14-sphinx..html#conf.py-(cont.)\n# https://stackoverflow.com/questions/38526888/embed-ipython-notebook-in-sphinx-document\n# I execute the notebooks manually in advance. If notebooks test the code,\n# they should be run at build time.\nnbsphinx_execute = \"never\"\nnbsphinx_allow_errors = True\nnbsphinx_requirejs_path = \"\"\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"generated/PULL_REQUEST_TEMPLATE.md\"]\n\n# myst-parser, forcing to parse all html pages with mathjax\n# https://github.com/executablebooks/MyST-Parser/issues/394\nmyst_update_mathjax = False\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\nsource_parsers = {\".rst\": \"restructuredtext\", \".txt\": \"markdown\", \".md\": \"markdown\", \".ipynb\": \"nbsphinx\"}\n\n# The master toctree document.\nmaster_doc = \"index\"\n\nneeds_sphinx = \"4.0\"\n\n# -- Options for intersphinx extension ---------------------------------------\n\n# Example configuration for intersphinx: refer to the Python standard library.\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3\", None),\n    \"torch\": (\"https://pytorch.org/docs/stable/\", None),\n    \"numpy\": (\"https://numpy.org/doc/stable/\", None),\n    \"PIL\": (\"https://pillow.readthedocs.io/en/stable/\", None),\n    \"pytorchvideo\": (\"https://pytorchvideo.readthedocs.io/en/latest/\", None),\n    \"pytorch_lightning\": (\"https://pytorch-lightning.readthedocs.io/en/stable/\", None),\n    \"fiftyone\": (\"https://voxel51.com/docs/fiftyone/\", \"fiftyone_objects.inv\"),\n}\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"pt_lightning_sphinx_theme\"\nhtml_theme_path = [pt_lightning_sphinx_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n\nhtml_theme_options = {\n    \"pytorch_project\": \"https://pytorchlightning.ai\",\n    \"canonical_url\": about.__docs_url__,\n    \"collapse_navigation\": False,\n    \"display_version\": True,\n    \"logo_only\": False,\n}\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\nhtml_css_files = []\n\n\ndef setup(app):\n    # this is for hiding doctest decoration,\n    # see: http://z4r.github.io/python/2011/12/02/hides-the-prompts-and-output/\n    app.add_js_file(\"copybutton.js\")\n    app.add_css_file(\"main.css\")\n\n\n# Ignoring Third-party packages\n# https://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule\ndef _package_list_from_file(pfile):\n    assert os.path.isfile(pfile)\n    with open(pfile) as fp:\n        lines = fp.readlines()\n    list_pkgs = []\n    for ln in lines:\n        found = [ln.index(ch) for ch in list(\",=<>#@\") if ch in ln]\n        pkg = ln[: min(found)] if found else ln\n        if pkg.strip():\n            list_pkgs.append(pkg.strip())\n    return list_pkgs\n\n\n# define mapping from PyPI names to python imports\nPACKAGE_MAPPING = {\n    \"pytorch-lightning\": \"pytorch_lightning\",\n    \"scikit-learn\": \"sklearn\",\n    \"Pillow\": \"PIL\",\n    \"PyYAML\": \"yaml\",\n    \"rouge-score\": \"rouge_score\",\n    \"lightning-bolts\": \"pl_bolts\",\n    \"pytorch-tabnet\": \"pytorch_tabnet\",\n    \"pyDeprecate\": \"deprecate\",\n}\nMOCK_PACKAGES = [\"numpy\", \"PyYAML\", \"tqdm\"]\nif SPHINX_MOCK_REQUIREMENTS:\n    # mock also base packages when we are on RTD since we don't install them there\n    MOCK_PACKAGES += _package_list_from_file(os.path.join(_PATH_ROOT, \"requirements.txt\"))\n# replace PyPI packages by importing ones\nMOCK_PACKAGES = [PACKAGE_MAPPING.get(pkg, pkg) for pkg in MOCK_PACKAGES]\n\nautodoc_mock_imports = MOCK_PACKAGES\n\n# only run doctests marked with a \".. doctest::\" directive\ndoctest_test_doctest_blocks = \"\"\ndoctest_global_setup = \"\"\"\nimport torch\nimport pytorch_lightning as pl\nimport flash\n\"\"\"\n", "path": "docs/source/conf.py"}], "after_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Path setup --------------------------------------------------------------\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\nimport glob\nimport os\nimport shutil\nimport sys\nimport warnings\nfrom importlib.util import module_from_spec, spec_from_file_location\n\nimport pt_lightning_sphinx_theme\n\n_PATH_HERE = os.path.abspath(os.path.dirname(__file__))\n_PATH_ROOT = os.path.join(_PATH_HERE, \"..\", \"..\")\n_PATH_RAW_NB = os.path.join(_PATH_ROOT, \"_notebooks\")\nsys.path.insert(0, os.path.abspath(_PATH_ROOT))\nsys.path.append(os.path.join(_PATH_RAW_NB, \".actions\"))\n\n_SHOULD_COPY_NOTEBOOKS = True\n\ntry:\n    from assistant import AssistantCLI\nexcept Exception:\n    _SHOULD_COPY_NOTEBOOKS = False\n    warnings.warn(\"To build the code, please run: `git submodule update --init --recursive`\", stacklevel=2)\n\n\ndef _load_py_module(fname, pkg=\"flash\"):\n    spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))\n    py = module_from_spec(spec)\n    spec.loader.exec_module(py)\n    return py\n\n\ntry:\n    from flash import __about__ as about\n    from flash.core.utilities import providers\n\nexcept ModuleNotFoundError:\n\n    about = _load_py_module(\"__about__.py\")\n    providers = _load_py_module(\"core/utilities/providers.py\")\n\nSPHINX_MOCK_REQUIREMENTS = int(os.environ.get(\"SPHINX_MOCK_REQUIREMENTS\", True))\n\nhtml_favicon = \"_static/images/icon.svg\"\n\n# -- Project information -----------------------------------------------------\n\nproject = \"Flash\"\ncopyright = \"2020-2021, PyTorch Lightning\"\nauthor = \"PyTorch Lightning\"\n\n# -- Project documents -------------------------------------------------------\nif _SHOULD_COPY_NOTEBOOKS:\n    AssistantCLI.copy_notebooks(_PATH_RAW_NB, _PATH_HERE, \"notebooks\", patterns=[\"flash_tutorials\"])\n\n\ndef _transform_changelog(path_in: str, path_out: str) -> None:\n    with open(path_in) as fp:\n        chlog_lines = fp.readlines()\n    # enrich short subsub-titles to be unique\n    chlog_ver = \"\"\n    for i, ln in enumerate(chlog_lines):\n        if ln.startswith(\"## \"):\n            chlog_ver = ln[2:].split(\"-\")[0].strip()\n        elif ln.startswith(\"### \"):\n            ln = ln.replace(\"###\", f\"### {chlog_ver} -\")\n            chlog_lines[i] = ln\n    with open(path_out, \"w\") as fp:\n        fp.writelines(chlog_lines)\n\n\ngenerated_dir = os.path.join(_PATH_HERE, \"generated\")\n\nos.makedirs(generated_dir, exist_ok=True)\n# copy all documents from GH templates like contribution guide\nfor md in glob.glob(os.path.join(_PATH_ROOT, \".github\", \"*.md\")):\n    shutil.copy(md, os.path.join(generated_dir, os.path.basename(md)))\n# copy also the changelog\n_transform_changelog(os.path.join(_PATH_ROOT, \"CHANGELOG.md\"), os.path.join(generated_dir, \"CHANGELOG.md\"))\n\n# -- Generate providers ------------------------------------------------------\n\nlines = []\nfor provider in providers.PROVIDERS:\n    lines.append(f\"- {str(provider)}\\n\")\n\ngenerated_dir = os.path.join(\"integrations\", \"generated\")\nos.makedirs(generated_dir, exist_ok=True)\n\nwith open(os.path.join(generated_dir, \"providers.rst\"), \"w\") as f:\n    f.writelines(sorted(lines, key=str.casefold))\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.doctest\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.todo\",\n    \"sphinx.ext.viewcode\",\n    \"sphinx.ext.autosummary\",\n    \"sphinx.ext.napoleon\",\n    \"sphinx.ext.imgmath\",\n    \"myst_parser\",\n    \"nbsphinx\",\n    \"sphinx_autodoc_typehints\",\n    \"sphinx_copybutton\",\n    \"sphinx_paramlinks\",\n    \"sphinx_togglebutton\",\n    \"pt_lightning_sphinx_theme.extensions.lightning_tutorials\",\n]\n\n# autodoc: Default to members and undoc-members\nautodoc_default_options = {\"members\": True}\n\n# autodoc: Don't inherit docstrings (e.g. for nn.Module.forward)\nautodoc_inherit_docstrings = False\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# https://berkeley-stat159-f17.github.io/stat159-f17/lectures/14-sphinx..html#conf.py-(cont.)\n# https://stackoverflow.com/questions/38526888/embed-ipython-notebook-in-sphinx-document\n# I execute the notebooks manually in advance. If notebooks test the code,\n# they should be run at build time.\nnbsphinx_execute = \"never\"\nnbsphinx_allow_errors = True\nnbsphinx_requirejs_path = \"\"\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"generated/PULL_REQUEST_TEMPLATE.md\"]\n\n# myst-parser, forcing to parse all html pages with mathjax\n# https://github.com/executablebooks/MyST-Parser/issues/394\nmyst_update_mathjax = False\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\nsource_parsers = {\".rst\": \"restructuredtext\", \".txt\": \"markdown\", \".md\": \"markdown\", \".ipynb\": \"nbsphinx\"}\n\n# The master toctree document.\nmaster_doc = \"index\"\n\nneeds_sphinx = \"4.0\"\n\n# -- Options for intersphinx extension ---------------------------------------\n\n# Example configuration for intersphinx: refer to the Python standard library.\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3\", None),\n    \"torch\": (\"https://pytorch.org/docs/stable/\", None),\n    \"numpy\": (\"https://numpy.org/doc/stable/\", None),\n    \"PIL\": (\"https://pillow.readthedocs.io/en/stable/\", None),\n    \"pytorchvideo\": (\"https://pytorchvideo.readthedocs.io/en/latest/\", None),\n    \"pytorch_lightning\": (\"https://pytorch-lightning.readthedocs.io/en/stable/\", None),\n    \"fiftyone\": (\"https://voxel51.com/docs/fiftyone/\", \"fiftyone_objects.inv\"),\n}\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"pt_lightning_sphinx_theme\"\nhtml_theme_path = [pt_lightning_sphinx_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n\nhtml_theme_options = {\n    \"pytorch_project\": \"https://pytorchlightning.ai\",\n    \"canonical_url\": about.__docs_url__,\n    \"collapse_navigation\": False,\n    \"display_version\": True,\n    \"logo_only\": False,\n}\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\nhtml_css_files = []\n\n\ndef setup(app):\n    # this is for hiding doctest decoration,\n    # see: http://z4r.github.io/python/2011/12/02/hides-the-prompts-and-output/\n    app.add_js_file(\"copybutton.js\")\n    app.add_css_file(\"main.css\")\n\n\n# Ignoring Third-party packages\n# https://stackoverflow.com/questions/15889621/sphinx-how-to-exclude-imports-in-automodule\ndef _package_list_from_file(pfile):\n    assert os.path.isfile(pfile)\n    with open(pfile) as fp:\n        lines = fp.readlines()\n    list_pkgs = []\n    for ln in lines:\n        found = [ln.index(ch) for ch in list(\",=<>#@\") if ch in ln]\n        pkg = ln[: min(found)] if found else ln\n        if pkg.strip():\n            list_pkgs.append(pkg.strip())\n    return list_pkgs\n\n\n# define mapping from PyPI names to python imports\nPACKAGE_MAPPING = {\n    \"pytorch-lightning\": \"pytorch_lightning\",\n    \"scikit-learn\": \"sklearn\",\n    \"Pillow\": \"PIL\",\n    \"PyYAML\": \"yaml\",\n    \"rouge-score\": \"rouge_score\",\n    \"lightning-bolts\": \"pl_bolts\",\n    \"pytorch-tabnet\": \"pytorch_tabnet\",\n    \"pyDeprecate\": \"deprecate\",\n}\nMOCK_PACKAGES = [\"numpy\", \"PyYAML\", \"tqdm\"]\nif SPHINX_MOCK_REQUIREMENTS:\n    # mock also base packages when we are on RTD since we don't install them there\n    MOCK_PACKAGES += _package_list_from_file(os.path.join(_PATH_ROOT, \"requirements.txt\"))\n# replace PyPI packages by importing ones\nMOCK_PACKAGES = [PACKAGE_MAPPING.get(pkg, pkg) for pkg in MOCK_PACKAGES]\n\nautodoc_mock_imports = MOCK_PACKAGES\n\n# only run doctests marked with a \".. doctest::\" directive\ndoctest_test_doctest_blocks = \"\"\ndoctest_global_setup = \"\"\"\nimport torch\nimport pytorch_lightning as pl\nimport flash\n\"\"\"\n", "path": "docs/source/conf.py"}]}