Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Basma Boussaha commited on
Commit ·
f8317f3
1
Parent(s): 2bda3df
fix
Browse files- backend/submission_handler.py +18 -18
backend/submission_handler.py
CHANGED
|
@@ -170,20 +170,20 @@ class SlackNotifier:
|
|
| 170 |
}
|
| 171 |
]
|
| 172 |
|
| 173 |
-
if submission_data:
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
|
| 188 |
blocks.append({
|
| 189 |
"type": "context",
|
|
@@ -390,7 +390,7 @@ def integrate_with_submission(original_submit_func):
|
|
| 390 |
submission_data = {
|
| 391 |
"model": args[0] if len(args) > 0 else kwargs.get("model_name"),
|
| 392 |
# "base_model": args[1] if len(args) > 1 else kwargs.get("base_model"),
|
| 393 |
-
"revision": args[2] if len(args) > 2 else kwargs.get("revision"),
|
| 394 |
# "precision": args[3] if len(args) > 3 else kwargs.get("precision"),
|
| 395 |
# "weight_type": args[4] if len(args) > 4 else kwargs.get("weight_type"),
|
| 396 |
"submitted_time": datetime.utcnow().isoformat() + "Z",
|
|
@@ -522,7 +522,7 @@ def check_org_threshold(org_name: str) -> Tuple[bool, str]:
|
|
| 522 |
@integrate_with_submission
|
| 523 |
def submit_model(
|
| 524 |
model_name: str,
|
| 525 |
-
base_model: Optional[str] = None,
|
| 526 |
revision: Optional[str] = "main",
|
| 527 |
# precision: str = "",
|
| 528 |
# weight_type: str = "",
|
|
@@ -534,8 +534,8 @@ def submit_model(
|
|
| 534 |
"""
|
| 535 |
# --- 1. Input Sanitization ---
|
| 536 |
model_name = model_name.strip()
|
| 537 |
-
if base_model:
|
| 538 |
-
|
| 539 |
revision = revision.strip() or "main"
|
| 540 |
# precision = precision.strip()
|
| 541 |
model_type = MODEL_TYPE_NORMALIZATION.get(model_type.strip().lower(), model_type.strip())
|
|
|
|
| 170 |
}
|
| 171 |
]
|
| 172 |
|
| 173 |
+
# if submission_data:
|
| 174 |
+
# blocks.append({
|
| 175 |
+
# "type": "section",
|
| 176 |
+
# "fields": [
|
| 177 |
+
# {
|
| 178 |
+
# "type": "mrkdwn",
|
| 179 |
+
# "text": f"*Precision:*\n{submission_data.get('precision', 'UNK')}"
|
| 180 |
+
# },
|
| 181 |
+
# {
|
| 182 |
+
# "type": "mrkdwn",
|
| 183 |
+
# "text": f"*Revision:*\n{submission_data.get('revision', 'main')}"
|
| 184 |
+
# }
|
| 185 |
+
# ]
|
| 186 |
+
# })
|
| 187 |
|
| 188 |
blocks.append({
|
| 189 |
"type": "context",
|
|
|
|
| 390 |
submission_data = {
|
| 391 |
"model": args[0] if len(args) > 0 else kwargs.get("model_name"),
|
| 392 |
# "base_model": args[1] if len(args) > 1 else kwargs.get("base_model"),
|
| 393 |
+
"revision": "main", # args[2] if len(args) > 2 else kwargs.get("revision"),
|
| 394 |
# "precision": args[3] if len(args) > 3 else kwargs.get("precision"),
|
| 395 |
# "weight_type": args[4] if len(args) > 4 else kwargs.get("weight_type"),
|
| 396 |
"submitted_time": datetime.utcnow().isoformat() + "Z",
|
|
|
|
| 522 |
@integrate_with_submission
|
| 523 |
def submit_model(
|
| 524 |
model_name: str,
|
| 525 |
+
# base_model: Optional[str] = None,
|
| 526 |
revision: Optional[str] = "main",
|
| 527 |
# precision: str = "",
|
| 528 |
# weight_type: str = "",
|
|
|
|
| 534 |
"""
|
| 535 |
# --- 1. Input Sanitization ---
|
| 536 |
model_name = model_name.strip()
|
| 537 |
+
# if base_model:
|
| 538 |
+
# base_model = base_model.strip()
|
| 539 |
revision = revision.strip() or "main"
|
| 540 |
# precision = precision.strip()
|
| 541 |
model_type = MODEL_TYPE_NORMALIZATION.get(model_type.strip().lower(), model_type.strip())
|