Spaces:
Running
Running
simonduerr
commited on
Commit
•
bfbddc7
1
Parent(s):
35a52a8
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,51 @@ import os
|
|
7 |
|
8 |
import json
|
9 |
|
|
|
|
|
10 |
from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
11 |
|
12 |
|
13 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
if model_name == "" or model_id == "" or challenge == "" or architecture == "" or license == "":
|
16 |
gr.Error("Please fill all the fields")
|
@@ -47,6 +88,8 @@ def submit(model_name, model_id, challenge, submission_id, paper_link, architect
|
|
47 |
repo_type="dataset",
|
48 |
commit_message=f"Add {model_name} to eval queue",
|
49 |
)
|
|
|
|
|
50 |
gr.Info("Successfully submitted", duration=10)
|
51 |
# Remove the local file
|
52 |
os.remove(out_path)
|
@@ -120,16 +163,17 @@ with gr.Blocks() as demo:
|
|
120 |
""")
|
121 |
model_name = gr.Textbox(label="Model name")
|
122 |
model_id = gr.Textbox(label="username/space e.g mlsb/alphafold3")
|
|
|
123 |
challenge = gr.Radio(choices=["PINDER", "PLINDER"],label="Challenge")
|
124 |
gr.Markdown("Either give a submission id if you submitted to the MLSB workshop or provide a link to the preprint/paper describing the method.")
|
125 |
with gr.Row():
|
126 |
submission_id = gr.Textbox(label="Submission ID on CMT")
|
127 |
paper_link = gr.Textbox(label="Preprint or Paper link")
|
128 |
-
architecture = gr.Dropdown(choices=["GNN", "CNN", "Physics-based", "Other"],label="Model architecture")
|
129 |
license = gr.Dropdown(choices=["mit", "apache-2.0", "gplv2", "gplv3", "lgpl", "mozilla", "bsd", "other"],label="License")
|
130 |
submit_btn = gr.Button("Submit")
|
131 |
|
132 |
-
submit_btn.click(submit, inputs=[model_name, model_id, challenge, submission_id, paper_link, architecture, license], outputs=[])
|
133 |
|
134 |
gr.Markdown("""
|
135 |
Please find more information about the challenges on [mlsb.io/#challenge](https://mlsb.io/#challenge)""")
|
|
|
7 |
|
8 |
import json
|
9 |
|
10 |
+
import requests
|
11 |
+
|
12 |
from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
|
13 |
|
14 |
|
15 |
+
def fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
|
16 |
+
name = get_name_by_day()
|
17 |
+
date, hour = str(get_gmt_time()).split(' ')
|
18 |
+
date = date.split('-')
|
19 |
+
hour = hour.split(':')
|
20 |
+
if (int(hour[0]) < 10):
|
21 |
+
hour[0] = hour[0][1:]
|
22 |
+
|
23 |
+
value = {
|
24 |
+
# Model name
|
25 |
+
"entry.1591601824": model_name,
|
26 |
+
# username/space
|
27 |
+
"entry.1171388028": model_id,
|
28 |
+
# Submission ID on CMT
|
29 |
+
"entry.171528970": submission_id,
|
30 |
+
# Preprint or paper link
|
31 |
+
"entry.1284338508": paper_link,
|
32 |
+
# Model architecture
|
33 |
+
"entry.1291571256": architecture,
|
34 |
+
# License
|
35 |
+
# Option: any text
|
36 |
+
"entry.272554778": license,
|
37 |
+
# Challenge
|
38 |
+
# Option: any text
|
39 |
+
"entry.1908975677": challenge,
|
40 |
+
# Email
|
41 |
+
# Option: any text
|
42 |
+
"entry.964644151": contact_email
|
43 |
+
}
|
44 |
+
|
45 |
+
return value
|
46 |
+
|
47 |
+
def sendForm(url, data):
|
48 |
+
try:
|
49 |
+
requests.post(url, data = data)
|
50 |
+
print("Submitted successfully!")
|
51 |
+
except:
|
52 |
+
print("Error!")
|
53 |
+
|
54 |
+
def submit(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
|
55 |
|
56 |
if model_name == "" or model_id == "" or challenge == "" or architecture == "" or license == "":
|
57 |
gr.Error("Please fill all the fields")
|
|
|
88 |
repo_type="dataset",
|
89 |
commit_message=f"Add {model_name} to eval queue",
|
90 |
)
|
91 |
+
sendForm("https://docs.google.com/forms/d/e/1FAIpQLSf1zP7RAFC5RLlva03xm0eIAPLKXOmMvNUzirbm82kdCUFKNw/viewform", fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license))
|
92 |
+
|
93 |
gr.Info("Successfully submitted", duration=10)
|
94 |
# Remove the local file
|
95 |
os.remove(out_path)
|
|
|
163 |
""")
|
164 |
model_name = gr.Textbox(label="Model name")
|
165 |
model_id = gr.Textbox(label="username/space e.g mlsb/alphafold3")
|
166 |
+
contact_email = gr.Textbox(label="Contact E-Mail")
|
167 |
challenge = gr.Radio(choices=["PINDER", "PLINDER"],label="Challenge")
|
168 |
gr.Markdown("Either give a submission id if you submitted to the MLSB workshop or provide a link to the preprint/paper describing the method.")
|
169 |
with gr.Row():
|
170 |
submission_id = gr.Textbox(label="Submission ID on CMT")
|
171 |
paper_link = gr.Textbox(label="Preprint or Paper link")
|
172 |
+
architecture = gr.Dropdown(choices=["GNN", "CNN","Diffusion Model", "Physics-based", "Other"],label="Model architecture")
|
173 |
license = gr.Dropdown(choices=["mit", "apache-2.0", "gplv2", "gplv3", "lgpl", "mozilla", "bsd", "other"],label="License")
|
174 |
submit_btn = gr.Button("Submit")
|
175 |
|
176 |
+
submit_btn.click(submit, inputs=[model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license], outputs=[])
|
177 |
|
178 |
gr.Markdown("""
|
179 |
Please find more information about the challenges on [mlsb.io/#challenge](https://mlsb.io/#challenge)""")
|