Skip to content

Commit fcfdec5

Browse files
Merge pull request #2272 from melissawm:contributing-docs
PiperOrigin-RevId: 807369031
2 parents f4ab533 + 50cd53a commit fcfdec5

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

docs/development.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
```{include} ../CONTRIBUTING.md
2+
```
3+
4+
## Contributing documentation
5+
6+
The MaxText documentation website is built using [Sphinx](https://www.sphinx-doc.org) and [MyST](https://myst-parser.readthedocs.io/en/latest/). Documents are written in [MyST Markdown syntax](https://myst-parser.readthedocs.io/en/latest/syntax/typography.html#syntax-core).
7+
8+
### Building the documentation locally (optional)
9+
10+
If you are writing documentation for MaxText, you may want to preview the documentation site locally to ensure things work as expected before a deployment to Read The Docs.
11+
12+
First, make sure you install the necessary dependencies. You can do this by navigating to your local clone of the MaxText repo and running:
13+
14+
```bash
15+
pip install -r requirements_docs.txt
16+
```
17+
18+
Once the dependencies are installed, you can navigate to the `docs/` folder and run:
19+
20+
```bash
21+
sphinx-build -b html . _build/html
22+
```
23+
24+
This will generate the documentation in the `docs/_build/html` directory. These files can be opened in a web browser directly, or you can use a simple HTTP server to serve the files. For example, you can run:
25+
26+
```bash
27+
python -m http.server -d docs/_build/html
28+
```
29+
30+
Then, open your web browser and navigate to `http://localhost:8000` to view the documentation.
31+
32+
### Adding new documentation files
33+
34+
If you are adding a new document, make sure it is included in the `toctree` directive corresponding to the section where the new document should live. For example, if adding a new tutorial, make sure it is listed in [the `docs/tutorials.md`](https://github.com/AI-Hypercomputer/maxtext/blob/7070e8eecbea8951c8e5281219ce797c8df1441f/docs/tutorials.md?plain=1#L38).
35+
36+
### Documentation deployment
37+
38+
The MaxText documentation is deployed to [https://maxtext.readthedocs.io](https://maxtext.readthedocs.io) on any successful merge to the main branch.

docs/guides/data_input_hf.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Hugging Face pipeline
22
The Hugging Face pipeline supports streaming directly from the Hugging Face Hub, or from a Cloud Storage bucket in Hugging Face supported formats (parquet, json, etc.). This is through the Hugging Face [`datasets.load_dataset` API](https://huggingface.co/docs/datasets/en/loading) with `streaming=True`, which takes in `hf_*` parameters.
33
## Example config for streaming from Hugging Face Hub (no download needed):
4+
45
In `src/MaxText/configs/base.yml` or through command line, set the following parameters:
56
```
67
dataset_type: hf
@@ -18,6 +19,7 @@ hf_access_token: '' # provide token if using gated dataset or tokenizer
1819
```
1920

2021
## Example config for streaming from downloaded data in a Cloud Storage bucket:
22+
2123
In `src/MaxText/configs/base.yml` or through command line, set the following parameters:
2224
```
2325
dataset_type: hf

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@ tutorials.md
100100
guides.md
101101
explanations.md
102102
reference.md
103+
development.md
103104
```

0 commit comments

Comments
 (0)