File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed
Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 448448 - sections :
449449 - local : api/pipelines/overview
450450 title : Overview
451+ - local : api/pipelines/auto_pipeline
452+ title : AutoPipeline
451453 - sections :
452454 - local : api/pipelines/audioldm
453455 title : AudioLDM
460462 - local : api/pipelines/stable_audio
461463 title : Stable Audio
462464 title : Audio
463- - local : api/pipelines/auto_pipeline
464- title : AutoPipeline
465465 - sections :
466466 - local : api/pipelines/amused
467467 title : aMUSEd
525525 title : HiDream-I1
526526 - local : api/pipelines/hunyuandit
527527 title : Hunyuan-DiT
528+ - local : api/pipelines/hunyuanimage21
529+ title : HunyuanImage2.1
528530 - local : api/pipelines/pix2pix
529531 title : InstructPix2Pix
530532 - local : api/pipelines/kandinsky
638640 title : ConsisID
639641 - local : api/pipelines/framepack
640642 title : Framepack
641- - local : api/pipelines/hunyuanimage21
642- title : HunyuanImage2.1
643643 - local : api/pipelines/hunyuan_video
644644 title : HunyuanVideo
645645 - local : api/pipelines/i2vgenxl
Original file line number Diff line number Diff line change 2121
2222PATH_TO_TOC = "docs/source/en/_toctree.yml"
2323
24+ # Titles that should maintain their position and not be sorted alphabetically
25+ FIXED_POSITION_TITLES = {"overview" , "autopipeline" }
26+
2427
2528def clean_doc_toc (doc_list ):
2629 """
2730 Cleans the table of content of the model documentation by removing duplicates and sorting models alphabetically.
2831 """
2932 counts = defaultdict (int )
30- overview_doc = []
33+ fixed_position_docs = []
3134 new_doc_list = []
3235 for doc in doc_list :
3336 if "local" in doc :
3437 counts [doc ["local" ]] += 1
3538
36- if doc ["title" ].lower () == "overview" :
37- overview_doc .append ({"local" : doc ["local" ], "title" : doc ["title" ]})
39+ if doc ["title" ].lower () in FIXED_POSITION_TITLES :
40+ fixed_position_docs .append ({"local" : doc ["local" ], "title" : doc ["title" ]})
3841 else :
3942 new_doc_list .append (doc )
4043
@@ -57,14 +60,13 @@ def clean_doc_toc(doc_list):
5760 new_doc .extend ([doc for doc in doc_list if "local" not in counts or counts [doc ["local" ]] == 1 ])
5861 new_doc = sorted (new_doc , key = lambda s : s ["title" ].lower ())
5962
60- # "overview" gets special treatment and is always first
61- if len (overview_doc ) > 1 :
62- raise ValueError ("{doc_list} has two 'overview' docs which is not allowed." )
63-
64- overview_doc .extend (new_doc )
63+ # Fixed-position titles maintain their original order
64+ result = []
65+ for doc in fixed_position_docs :
66+ result .append (doc )
6567
66- # Sort
67- return overview_doc
68+ result . extend ( new_doc )
69+ return result
6870
6971
7072def check_scheduler_doc (overwrite = False ):
You can’t perform that action at this time.
0 commit comments