kleinay commited on
Commit
00d2037
1 Parent(s): 1a6a8d7

don't use huggingface_hub.list_repo_files

Browse files
Files changed (1) hide show
  1. qasrl_model_pipeline.py +1 -1
qasrl_model_pipeline.py CHANGED
@@ -34,7 +34,7 @@ def load_trained_model(name_or_path):
34
  model = AutoModelForSeq2SeqLM.from_pretrained(name_or_path)
35
  # load preprocessing_kwargs from the model repo on HF hub, or from the local model directory
36
  kwargs_filename = None
37
- if name_or_path.startswith("kleinay/") and 'preprocessing_kwargs.json' in HFhub.list_repo_files(name_or_path):
38
  kwargs_filename = HFhub.hf_hub_download(repo_id=name_or_path, filename="preprocessing_kwargs.json")
39
  elif Path(name_or_path).is_dir() and (Path(name_or_path) / "experiment_kwargs.json").exists():
40
  kwargs_filename = Path(name_or_path) / "experiment_kwargs.json"
 
34
  model = AutoModelForSeq2SeqLM.from_pretrained(name_or_path)
35
  # load preprocessing_kwargs from the model repo on HF hub, or from the local model directory
36
  kwargs_filename = None
37
+ if name_or_path.startswith("kleinay/"): # and 'preprocessing_kwargs.json' in HFhub.list_repo_files(name_or_path): # the supported version of HFhub doesn't support list_repo_files
38
  kwargs_filename = HFhub.hf_hub_download(repo_id=name_or_path, filename="preprocessing_kwargs.json")
39
  elif Path(name_or_path).is_dir() and (Path(name_or_path) / "experiment_kwargs.json").exists():
40
  kwargs_filename = Path(name_or_path) / "experiment_kwargs.json"