Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Improve name of the model detection to allow several URL usages
Browse filesTo avoid the following error `huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name'` when submitting the URL of the model repository in the following forms:
- https://huggingface.co/spaces/hf-accelerate/model-memory-usage/
- https://huggingface.co/spaces/hf-accelerate/model-memory-usage/foo
- src/model_utils.py +2 -2
src/model_utils.py
CHANGED
@@ -23,8 +23,8 @@ def extract_from_url(name: str):
|
|
23 |
if not is_url:
|
24 |
return name
|
25 |
else:
|
26 |
-
path = result.path
|
27 |
-
return path[1:]
|
28 |
|
29 |
|
30 |
def translate_llama2(text):
|
|
|
23 |
if not is_url:
|
24 |
return name
|
25 |
else:
|
26 |
+
path = result.path.split('/')
|
27 |
+
return '/'.join(path[1:3])
|
28 |
|
29 |
|
30 |
def translate_llama2(text):
|