File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def download_huggingface_model(
139139 model_name : str ,
140140 target_dir : str = "." ,
141141 remove_hf_folder : bool = True ,
142- rename_mapping : dict | None = None ,
142+ rename_mapping : str | dict | None = None ,
143143):
144144 """
145145 Downloads a DeepLabCut Model Zoo Project from Hugging Face.
@@ -180,6 +180,10 @@ def download_huggingface_model(
180180 path_ = os .path .join (target_dir , hf_folder , "snapshots" )
181181 commit = os .listdir (path_ )[0 ]
182182 file_name = os .path .join (path_ , commit , targzfn )
183+
184+ if isinstance (rename_mapping , str ):
185+ rename_mapping = {targzfn : rename_mapping }
186+
183187 _handle_downloaded_file (file_name , target_dir , rename_mapping )
184188
185189 if remove_hf_folder :
You can’t perform that action at this time.
0 commit comments