diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..942311cffc --- /dev/null +++ b/docs/README.md @@ -0,0 +1,58 @@ +# Generating the documentation + +To generate the documentation, you have to build it. Several packages are necessary to build the doc. + +First, you need to install the project itself by running the following command at the root of the code repository: + +```bash +pip install -e . +``` + +You also need to install 2 extra packages: + +```bash +# `hf-doc-builder` to build the docs +pip install git+https://github.com/huggingface/doc-builder@main +# `watchdog` for live reloads +pip install watchdog +``` + +--- +**NOTE** + +You only need to generate the documentation to inspect it locally (if you're planning changes and want to +check how they look before committing for instance). You don't have to commit the built documentation. + +--- + +## Building the documentation + +Once you have setup the `doc-builder` and additional packages with the pip install command above, +you can generate the documentation by typing the following command: + +```bash +doc-builder build autotrain docs/source/ --build_dir ~/tmp/test-build +``` + +You can adapt the `--build_dir` to set any temporary folder that you prefer. This command will create it and generate +the MDX files that will be rendered as the documentation on the main website. You can inspect them in your favorite +Markdown editor. + +## Previewing the documentation + +To preview the docs, run the following command: + +```bash +doc-builder preview autotrain docs/source/ +``` + +The docs will be viewable at [http://localhost:5173](http://localhost:5173). You can also preview the docs once you +have opened a PR. You will see a bot add a comment to a link where the documentation with your changes lives. + +--- +**NOTE** + +The `preview` command only works with existing doc files. When you add a completely new file, you need to update +`_toctree.yml` & restart `preview` command (`ctrl-c` to stop it & call `doc-builder preview ...` again). + +--- \ No newline at end of file diff --git a/docs/source/text_classification_params.mdx b/docs/source/text_classification_params.mdx index c98c219a45..cf38899b9f 100644 --- a/docs/source/text_classification_params.mdx +++ b/docs/source/text_classification_params.mdx @@ -1,5 +1,7 @@ # Text Classification & Regression Parameters +[[autodoc]] trainers.text_classification.params.TextClassificationParams + ``` --batch-size BATCH_SIZE Training batch size to use diff --git a/src/autotrain/project.py b/src/autotrain/project.py index f2125879aa..de65f153e1 100644 --- a/src/autotrain/project.py +++ b/src/autotrain/project.py @@ -27,7 +27,7 @@ @dataclass class AutoTrainProject: """ - A class to represent an AutoTrain project. + A class to represent an AutoTrain project Attributes ---------- diff --git a/src/autotrain/trainers/text_classification/params.py b/src/autotrain/trainers/text_classification/params.py index aeac76218f..b03758adad 100644 --- a/src/autotrain/trainers/text_classification/params.py +++ b/src/autotrain/trainers/text_classification/params.py @@ -7,7 +7,7 @@ class TextClassificationParams(AutoTrainParams): """ - TextClassificationParams is a configuration class for text classification training parameters. + [`TextClassificationParams`] is a configuration class for text classification training parameters. Attributes: data_path (str): Path to the dataset.