diff options
author | ZJaume <jzaragoza@prompsit.com> | 2022-08-09 17:28:06 +0300 |
---|---|---|
committer | ZJaume <jzaragoza@prompsit.com> | 2022-08-09 17:28:06 +0300 |
commit | 5266d5a5b9378c58f1f9a895e718544b8ebe8071 (patch) | |
tree | f1c2db7e98c2c8b3bd9f8ada1af83c0d63c3b776 | |
parent | 87f17a6079f9cabc14feb9a2cb594061dc99aa0f (diff) |
Fix loading local models
-rwxr-xr-x | bicleaner_ai/bicleaner_ai_classifier.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bicleaner_ai/bicleaner_ai_classifier.py b/bicleaner_ai/bicleaner_ai_classifier.py index ba57d5f..c139671 100755 --- a/bicleaner_ai/bicleaner_ai_classifier.py +++ b/bicleaner_ai/bicleaner_ai_classifier.py @@ -58,7 +58,7 @@ def initialization(): try: # Check if it exists at the HF Hub model_info(args.model, token=args.auth_token) - except RepositoryNotFoundError: + except (RepositoryNotFoundError, HTTPError): hub_not_found = True args.metadata = args.model + '/metadata.yaml' else: @@ -74,8 +74,8 @@ def initialization(): if not os.path.isfile(args.metadata): if hub_not_found: logging.error( - f"Model {args.model} not found at HF Hub") - raise FileNotFoundError(f"model {args.model} no such file") + f"Model {args.model} not found at HF Hub. If the model is private use --auth_token option.") + raise FileNotFoundError(f"model {args.metadata} no such file") # Load metadata YAML args = load_metadata(args, parser) |