Spaces:
Runtime error
Runtime error
feat: disable model card check
Browse files- src/utils.py +0 -16
src/utils.py
CHANGED
|
@@ -265,26 +265,10 @@ def submit_results(
|
|
| 265 |
# TODO: retrieve the model page and find the model name on the page
|
| 266 |
return styled_error(
|
| 267 |
f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
|
| 268 |
-
if model_url.startswith("https://huggingface.co/"):
|
| 269 |
-
# validate model card
|
| 270 |
-
repo_id = model_url.removeprefix("https://huggingface.co/")
|
| 271 |
-
try:
|
| 272 |
-
card = ModelCard.load(repo_id)
|
| 273 |
-
except EntryNotFoundError as e:
|
| 274 |
-
return styled_error(
|
| 275 |
-
f"failed to submit. Model url must be a link to a valid HuggingFace model on HuggingFace space. Could not get model {repo_id}")
|
| 276 |
if reranking_model != "NoReranker":
|
| 277 |
if not reranking_model_url.startswith("https://") and not reranking_model_url.startswith("http://"):
|
| 278 |
return styled_error(
|
| 279 |
f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
|
| 280 |
-
if reranking_model_url.startswith("https://huggingface.co/"):
|
| 281 |
-
# validate model card
|
| 282 |
-
repo_id = reranking_model_url.removeprefix("https://huggingface.co/")
|
| 283 |
-
try:
|
| 284 |
-
card = ModelCard.load(repo_id)
|
| 285 |
-
except EntryNotFoundError as e:
|
| 286 |
-
return styled_error(
|
| 287 |
-
f"failed to submit. Model url must be a link to a valid HuggingFace model on HuggingFace space. Could not get model {repo_id}")
|
| 288 |
|
| 289 |
# rename the uploaded file
|
| 290 |
input_fp = Path(filepath)
|
|
|
|
| 265 |
# TODO: retrieve the model page and find the model name on the page
|
| 266 |
return styled_error(
|
| 267 |
f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
if reranking_model != "NoReranker":
|
| 269 |
if not reranking_model_url.startswith("https://") and not reranking_model_url.startswith("http://"):
|
| 270 |
return styled_error(
|
| 271 |
f"failed to submit. Model url must start with `https://` or `http://`. Illegal model url: {model_url}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
# rename the uploaded file
|
| 274 |
input_fp = Path(filepath)
|