maximedenes commited on
Commit
c84b309
Β·
1 Parent(s): fef2765

Do not check duplicate submissions against finished ones

Browse files

This change should be reverted if models are no longer anonymous.

Files changed (1) hide show
  1. backend/app/services/models.py +9 -8
backend/app/services/models.py CHANGED
@@ -412,18 +412,19 @@ class ModelService(HuggingFaceService):
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)
 
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
+ # is_valid, error_message = await self.validator.check_official_provider_status(
418
+ # model_data["model_id"],
419
+ # existing_models
420
+ #)
421
+ #if not is_valid:
422
+ # raise ValueError(error_message)
423
 
424
+ # Check in all statuses except finished (as long as models are anonymous)
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"] and status.lower() != "finished":
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)