poltextlab commited on
Commit
5e7a4a4
1 Parent(s): b5e3ca1

update cap to not check if model is available

Browse files

The 'huggingface_hub.utils._errors' module produced errors if it wasn't the newest. We made the checking system more ambiguous so we don't rely on that module anymore.

Files changed (1) hide show
  1. interfaces/cap.py +1 -2
interfaces/cap.py CHANGED
@@ -7,7 +7,6 @@ import pandas as pd
7
  from transformers import AutoModelForSequenceClassification
8
  from transformers import AutoTokenizer
9
  from huggingface_hub import HfApi
10
- from huggingface_hub.utils._errors import RepositoryNotFoundError
11
 
12
  from label_dicts import CAP_NUM_DICT, CAP_LABEL_NAMES
13
 
@@ -37,7 +36,7 @@ def check_huggingface_path(checkpoint_path: str):
37
  hf_api = HfApi(token=HF_TOKEN)
38
  hf_api.model_info(checkpoint_path, token=HF_TOKEN)
39
  return True
40
- except RepositoryNotFoundError:
41
  return False
42
 
43
  def build_huggingface_path(language: str, domain: str):
 
7
  from transformers import AutoModelForSequenceClassification
8
  from transformers import AutoTokenizer
9
  from huggingface_hub import HfApi
 
10
 
11
  from label_dicts import CAP_NUM_DICT, CAP_LABEL_NAMES
12
 
 
36
  hf_api = HfApi(token=HF_TOKEN)
37
  hf_api.model_info(checkpoint_path, token=HF_TOKEN)
38
  return True
39
+ except:
40
  return False
41
 
42
  def build_huggingface_path(language: str, domain: str):