adding progress
Browse files- src/submission/submit.py +7 -2
src/submission/submit.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
from datetime import datetime, timezone
|
4 |
-
|
5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
6 |
from src.envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
7 |
from src.submission.check_validity import (
|
@@ -17,6 +17,7 @@ USERS_TO_SUBMISSION_DATES = None
|
|
17 |
|
18 |
def add_new_eval(
|
19 |
model: str,
|
|
|
20 |
#base_model: str,
|
21 |
#revision: str,
|
22 |
#precision: str,
|
@@ -37,6 +38,9 @@ def add_new_eval(
|
|
37 |
#precision = precision.split(" ")[0]
|
38 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
39 |
|
|
|
|
|
|
|
40 |
if not is_model_on_hub(model_name=model, token=TOKEN, test_tokenizer=True): #revision=revision
|
41 |
return styled_error("Model does not exist on HF Hub. Please select a valid model name.")
|
42 |
|
@@ -99,6 +103,7 @@ def add_new_eval(
|
|
99 |
#"private": False,
|
100 |
}
|
101 |
|
|
|
102 |
# Check for duplicate submission
|
103 |
if f"{model}" in REQUESTED_MODELS: #_{revision}_{precision}
|
104 |
return styled_warning("This model has been already submitted.")
|
@@ -162,5 +167,5 @@ def add_new_eval(
|
|
162 |
|
163 |
|
164 |
return styled_message(
|
165 |
-
"
|
166 |
)
|
|
|
1 |
import json
|
2 |
import os
|
3 |
from datetime import datetime, timezone
|
4 |
+
import gradio as gr
|
5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
6 |
from src.envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
7 |
from src.submission.check_validity import (
|
|
|
17 |
|
18 |
def add_new_eval(
|
19 |
model: str,
|
20 |
+
progress=gr.Progress()
|
21 |
#base_model: str,
|
22 |
#revision: str,
|
23 |
#precision: str,
|
|
|
38 |
#precision = precision.split(" ")[0]
|
39 |
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
40 |
|
41 |
+
|
42 |
+
progress(0.1, desc=f"Checking model {model} on hub")
|
43 |
+
|
44 |
if not is_model_on_hub(model_name=model, token=TOKEN, test_tokenizer=True): #revision=revision
|
45 |
return styled_error("Model does not exist on HF Hub. Please select a valid model name.")
|
46 |
|
|
|
103 |
#"private": False,
|
104 |
}
|
105 |
|
106 |
+
progress(0.5, desc=f"Checking previous submissions")
|
107 |
# Check for duplicate submission
|
108 |
if f"{model}" in REQUESTED_MODELS: #_{revision}_{precision}
|
109 |
return styled_warning("This model has been already submitted.")
|
|
|
167 |
|
168 |
|
169 |
return styled_message(
|
170 |
+
"Thank you for submitting your request! It has been placed in the evaluation queue. Please allow up to 15 minutes for the model to appear in the PENDING list"
|
171 |
)
|