Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
Β·
9551f94
1
Parent(s):
3bb5606
Revert "Do not check duplicate submissions against finished ones"
Browse filesThis reverts commit c84b309a78085108e663a98a8a1dde54c06d012d.
backend/app/services/models.py
CHANGED
@@ -412,19 +412,18 @@ class ModelService(HuggingFaceService):
|
|
412 |
logger.info(LogFormatter.subsection("CHECKING EXISTING SUBMISSIONS"))
|
413 |
existing_models = await self.get_models()
|
414 |
|
415 |
-
# Put back when model anonymization is gone:
|
416 |
# Call the official provider status check
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
|
424 |
-
# Check in all statuses
|
425 |
for status, models in existing_models.items():
|
426 |
for model in models:
|
427 |
-
if model["name"] == model_data["model_id"] and model["revision"] == model_data["revision"]
|
428 |
error_msg = f"Model {model_data['model_id']} revision {model_data['revision']} is already in the system with status: {status}"
|
429 |
logger.error(LogFormatter.error("Submission rejected", error_msg))
|
430 |
raise ValueError(error_msg)
|
|
|
412 |
logger.info(LogFormatter.subsection("CHECKING EXISTING SUBMISSIONS"))
|
413 |
existing_models = await self.get_models()
|
414 |
|
|
|
415 |
# Call the official provider status check
|
416 |
+
is_valid, error_message = await self.validator.check_official_provider_status(
|
417 |
+
model_data["model_id"],
|
418 |
+
existing_models
|
419 |
+
)
|
420 |
+
if not is_valid:
|
421 |
+
raise ValueError(error_message)
|
422 |
|
423 |
+
# Check in all statuses (pending, evaluating, finished)
|
424 |
for status, models in existing_models.items():
|
425 |
for model in models:
|
426 |
+
if model["name"] == model_data["model_id"] and model["revision"] == model_data["revision"]:
|
427 |
error_msg = f"Model {model_data['model_id']} revision {model_data['revision']} is already in the system with status: {status}"
|
428 |
logger.error(LogFormatter.error("Submission rejected", error_msg))
|
429 |
raise ValueError(error_msg)
|