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 450450 - sections :
451451 - local : api/pipelines/overview
452452 title : Overview
453+ - local : api/pipelines/auto_pipeline
454+ title : AutoPipeline
453455 - sections :
454456 - local : api/pipelines/audioldm
455457 title : AudioLDM
462464 - local : api/pipelines/stable_audio
463465 title : Stable Audio
464466 title : Audio
465- - local : api/pipelines/auto_pipeline
466- title : AutoPipeline
467467 - sections :
468468 - local : api/pipelines/amused
469469 title : aMUSEd
527527 title : HiDream-I1
528528 - local : api/pipelines/hunyuandit
529529 title : Hunyuan-DiT
530+ - local : api/pipelines/hunyuanimage21
531+ title : HunyuanImage2.1
530532 - local : api/pipelines/pix2pix
531533 title : InstructPix2Pix
532534 - local : api/pipelines/kandinsky
640642 title : ConsisID
641643 - local : api/pipelines/framepack
642644 title : Framepack
643- - local : api/pipelines/hunyuanimage21
644- title : HunyuanImage2.1
645645 - local : api/pipelines/hunyuan_video
646646 title : HunyuanVideo
647647 - 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