eduardo-alvarez
commited on
Commit
•
d1b5244
1
Parent(s):
5d799e5
adding better submission handling
Browse files- app.py +5 -1
- src/processing.py +0 -1
app.py
CHANGED
@@ -25,7 +25,7 @@ from info.validated_chat_models import(
|
|
25 |
VALIDATED_CHAT_MODELS)
|
26 |
from info.about import(
|
27 |
ABOUT)
|
28 |
-
from src.processing import filter_benchmarks_table
|
29 |
|
30 |
inference_endpoint_url = os.environ['inference_endpoint_url']
|
31 |
submission_form_endpoint_url = os.environ['submission_form_endpoint_url']
|
@@ -65,6 +65,10 @@ with demo:
|
|
65 |
# URL of the endpoint expecting the HTTP request
|
66 |
url = submission_form_endpoint_url
|
67 |
|
|
|
|
|
|
|
|
|
68 |
try:
|
69 |
response = requests.post(url, json=data)
|
70 |
if response.status_code == 200:
|
|
|
25 |
VALIDATED_CHAT_MODELS)
|
26 |
from info.about import(
|
27 |
ABOUT)
|
28 |
+
from src.processing import filter_benchmarks_table, validate_data
|
29 |
|
30 |
inference_endpoint_url = os.environ['inference_endpoint_url']
|
31 |
submission_form_endpoint_url = os.environ['submission_form_endpoint_url']
|
|
|
65 |
# URL of the endpoint expecting the HTTP request
|
66 |
url = submission_form_endpoint_url
|
67 |
|
68 |
+
for key, value in data.items():
|
69 |
+
if value == "" or (key == "terms" and value is False):
|
70 |
+
return f"❌ Failed Submission: '{key}' ensure all fields are completed and that you have agreed to evaluation terms."
|
71 |
+
|
72 |
try:
|
73 |
response = requests.post(url, json=data)
|
74 |
if response.status_code == 200:
|
src/processing.py
CHANGED
@@ -16,5 +16,4 @@ def filter_benchmarks_table(df, hw_selected, platform_selected,
|
|
16 |
def make_clickable(val):
|
17 |
return f'<a target="_blank" href="{val}">{val}</a>'
|
18 |
|
19 |
-
|
20 |
|
|
|
16 |
def make_clickable(val):
|
17 |
return f'<a target="_blank" href="{val}">{val}</a>'
|
18 |
|
|
|
19 |
|