We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08b3a55 commit 1dab293Copy full SHA for 1dab293
src/setfit/model_card.py
@@ -432,6 +432,9 @@ def register_model(self, model: "SetFitModel") -> None:
432
def infer_st_id(self, setfit_model_id: str) -> None:
433
config_dict, _ = PretrainedConfig.get_config_dict(setfit_model_id)
434
st_id = config_dict.get("_name_or_path")
435
+ if st_id is None:
436
+ # If we can't access _name_or_path, we can't infer the base model ID
437
+ return
438
st_id_path = Path(st_id)
439
# Sometimes the name_or_path ends exactly with the model_id, e.g.
440
# "C:\\Users\\tom/.cache\\torch\\sentence_transformers\\BAAI_bge-small-en-v1.5\\"
0 commit comments