Skip to content

Commit 3d130c9

Browse files
setup the Documentation.
1 parent ad20de9 commit 3d130c9

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.8"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
fail_on_warning: false
11+
12+
python:
13+
install:
14+
- method: pip
15+
path: .
16+
extra_requirements:
17+
- dev
18+
- requirements: docs/requirements.txt
19+
20+
formats:
21+
- pdf
22+
- epub

docs/conf.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
version = '0.1.0'
99
release = '0.1.0'
1010

11+
# RTD configurations
12+
on_rtd = os.environ.get('READTHEDOCS') == 'True'
13+
1114
extensions = [
1215
'sphinx.ext.autodoc',
1316
'sphinx.ext.napoleon',
@@ -24,16 +27,38 @@
2427
html_theme = 'sphinx_rtd_theme'
2528
html_static_path = ['_static']
2629

30+
# Configure intersphinx mapping
2731
intersphinx_mapping = {
2832
'python': ('https://docs.python.org/3', None),
2933
'torch': ('https://pytorch.org/docs/stable', None),
3034
'transformers': ('https://huggingface.co/transformers/master', None),
3135
}
3236

37+
# Autodoc configurations
3338
autodoc_default_options = {
3439
'members': True,
3540
'member-order': 'bysource',
3641
'special-members': '__init__',
3742
'undoc-members': True,
3843
'exclude-members': '__weakref__'
39-
}
44+
}
45+
46+
# Napoleon settings
47+
napoleon_google_docstring = True
48+
napoleon_numpy_docstring = True
49+
napoleon_include_init_with_doc = True
50+
napoleon_include_private_with_doc = False
51+
napoleon_include_special_with_doc = True
52+
napoleon_use_admonition_for_examples = True
53+
napoleon_use_admonition_for_notes = True
54+
napoleon_use_admonition_for_references = True
55+
napoleon_use_ivar = False
56+
napoleon_use_param = True
57+
napoleon_use_rtype = True
58+
napoleon_type_aliases = None
59+
60+
# MyST parser settings
61+
myst_enable_extensions = [
62+
"colon_fence",
63+
"deflist"
64+
]

docs/requirements.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sphinx>=4.5.0
2+
sphinx-rtd-theme>=1.0.0
3+
sphinx-copybutton>=0.5.0
4+
sphinx-autodoc-typehints>=1.18.3
5+
myst-parser>=0.18.1
6+
# Package dependencies
7+
torch>=2.0.0
8+
transformers>=4.30.0
9+
datasets>=2.12.0
10+
accelerate>=0.20.0
11+
peft>=0.4.0
12+
bitsandbytes>=0.40.0
13+
scipy>=1.10.0
14+
scikit-learn>=1.0.0
15+
tqdm>=4.65.0
16+
numpy>=1.24.0
17+
wandb>=0.15.0

0 commit comments

Comments
 (0)