Skip to content

Commit 7a8eb94

Browse files
authored
fix chanese doc bug (#881)
1 parent 4af0160 commit 7a8eb94

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
run: |
7878
pip install -r tests/requirements.txt
7979
pytest --lf --durations=0 -v tests/doc_check
80+
LAZYLLM_LANGUAGE=CHINESE pytest --lf --durations=0 -v tests/doc_check
8081
8182
clone:
8283
if: |

lazyllm/docs/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def add_doc(obj_name, docstr, module, append=''):
7070

7171
obj = module
7272
for n in obj_name.split('.'):
73-
if isinstance(obj, type): obj = obj.__dict__[n]
73+
if isinstance(obj, type):
74+
obj = obj.__dict__[n] if n in obj.__dict__ else getattr(obj, n)
7475
else: obj = getattr(obj, n)
7576
if isinstance(obj, (classmethod, staticmethod, lazyllm.DynamicDescriptor)): obj = obj.__func__
7677
try:

0 commit comments

Comments
 (0)