Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bitextor/bicleaner-ai.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZJaume <jzaragoza@prompsit.com>2022-08-09 17:28:06 +0300
committerZJaume <jzaragoza@prompsit.com>2022-08-09 17:28:06 +0300
commit5266d5a5b9378c58f1f9a895e718544b8ebe8071 (patch)
treef1c2db7e98c2c8b3bd9f8ada1af83c0d63c3b776
parent87f17a6079f9cabc14feb9a2cb594061dc99aa0f (diff)
Fix loading local models
-rwxr-xr-xbicleaner_ai/bicleaner_ai_classifier.py6
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)