Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed Sep 27, 2024
1 parent e5a3b02 commit c507630
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
58 changes: 58 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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).

---
2 changes: 2 additions & 0 deletions docs/source/text_classification_params.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Text Classification & Regression Parameters

[[autodoc]] trainers.text_classification.params.TextClassificationParams

```
--batch-size BATCH_SIZE
Training batch size to use
Expand Down
2 changes: 1 addition & 1 deletion src/autotrain/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@dataclass
class AutoTrainProject:
"""
A class to represent an AutoTrain project.
A class to represent an AutoTrain project
Attributes
----------
Expand Down
2 changes: 1 addition & 1 deletion src/autotrain/trainers/text_classification/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c507630

Please sign in to comment.