Commit
·
813ce52
1
Parent(s):
fe04bb9
Fixed website, now need to get submissions working again
Browse files
about.py
CHANGED
@@ -49,7 +49,13 @@ TODO
|
|
49 |
|
50 |
TODO
|
51 |
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
"""
|
54 |
FAQS = {
|
55 |
"Example FAQ with dropdown": """Full answer to this question""",
|
|
|
49 |
|
50 |
TODO
|
51 |
|
52 |
+
**How to contribute?**
|
53 |
+
|
54 |
+
We'd like to add some more existing models to the leaderboard. Some examples of models we'd like to add:
|
55 |
+
- TODO
|
56 |
+
|
57 |
+
**FAQs**
|
58 |
+
|
59 |
"""
|
60 |
FAQS = {
|
61 |
"Example FAQ with dropdown": """Full answer to this question""",
|
app.py
CHANGED
@@ -25,7 +25,7 @@ def get_leaderboard_object(assay: str | None = None):
|
|
25 |
filter_columns.append("property")
|
26 |
# TODO how to sort filter columns alphabetically?
|
27 |
Leaderboard(
|
28 |
-
# TODO(Lood) check
|
29 |
value=format_leaderboard_table(df_results=fetch_hf_results(), assay=assay),
|
30 |
datatype=["str", "str", "str", "number"],
|
31 |
select_columns=["model", "property", "spearman", "spearman_cross_val"],
|
@@ -39,58 +39,43 @@ with gr.Blocks() as demo:
|
|
39 |
gr.Markdown("""
|
40 |
## Welcome to the Ginkgo Antibody Developability Benchmark!
|
41 |
|
|
|
|
|
42 |
Participants can submit their model to the leaderboard by uploading a CSV file (see the "✉️ Submit" tab).
|
43 |
See more details in the "❔About" tab.
|
44 |
""")
|
45 |
with gr.Tabs(elem_classes="tab-buttons"):
|
46 |
-
# Procedurally make these 5 tabs
|
47 |
-
for assay in ASSAY_LIST:
|
48 |
-
with gr.TabItem(f"{ASSAY_EMOJIS[assay]} {ASSAY_RENAME[assay]}", elem_id=f"abdev-benchmark-tab-table"):
|
49 |
-
gr.Markdown(f"# {ASSAY_DESCRIPTION[assay]}")
|
50 |
-
get_leaderboard_object(assay=assay)
|
51 |
-
|
52 |
-
with gr.TabItem("🚀 Overall", elem_id="abdev-benchmark-tab-table"):
|
53 |
-
gr.Markdown("# Antibody Developability Benchmark Leaderboard over all properties")
|
54 |
-
get_leaderboard_object()
|
55 |
-
# TODO: this is not going to update well, need to fix
|
56 |
-
|
57 |
with gr.TabItem("❔About", elem_id="abdev-benchmark-tab-table"):
|
58 |
-
gr.Markdown(
|
59 |
-
"""
|
60 |
-
<style>
|
61 |
-
.resized-image img {
|
62 |
-
width: 80%;
|
63 |
-
height: auto;
|
64 |
-
display: block;
|
65 |
-
margin-left: auto;
|
66 |
-
margin-right: auto;
|
67 |
-
}
|
68 |
-
|
69 |
-
@media (max-width: 768px) {
|
70 |
-
.resized-image img {
|
71 |
-
width: 100%;
|
72 |
-
}
|
73 |
-
}
|
74 |
-
</style>
|
75 |
-
""",
|
76 |
-
elem_id="style-inject"
|
77 |
-
)
|
78 |
gr.Image(
|
79 |
value="./assets/competition_logo.jpg",
|
80 |
show_label=False,
|
81 |
-
elem_classes=["resized-image"],
|
82 |
show_download_button=False,
|
|
|
83 |
)
|
84 |
gr.Markdown(ABOUT_TEXT)
|
85 |
for question, answer in FAQS.items():
|
86 |
with gr.Accordion(question):
|
87 |
gr.Markdown(answer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
with gr.TabItem("✉️ Submit", elem_id="boundary-benchmark-tab-table"):
|
90 |
gr.Markdown(
|
91 |
"""
|
92 |
# Antibody Developability Submission
|
93 |
Upload a CSV to get a score!
|
|
|
|
|
|
|
94 |
"""
|
95 |
)
|
96 |
filename = gr.State(value=None)
|
@@ -98,7 +83,7 @@ with gr.Blocks() as demo:
|
|
98 |
user_state = gr.State(value=None)
|
99 |
anonymous_state = gr.State(value=False)
|
100 |
|
101 |
-
gr.LoginButton()
|
102 |
|
103 |
with gr.Row():
|
104 |
with gr.Column():
|
@@ -108,10 +93,11 @@ with gr.Blocks() as demo:
|
|
108 |
info="This will be displayed on the leaderboard."
|
109 |
)
|
110 |
|
111 |
-
anonymous_checkbox = gr.Checkbox(label="Would you like to keep your submission anonymous?")
|
112 |
with gr.Column():
|
113 |
-
|
114 |
|
|
|
115 |
username_input.change(
|
116 |
fn=lambda x: x if x.strip() else None,
|
117 |
inputs=username_input,
|
@@ -125,7 +111,7 @@ with gr.Blocks() as demo:
|
|
125 |
|
126 |
submit_btn.click(
|
127 |
make_submission,
|
128 |
-
inputs=[
|
129 |
outputs=[message],
|
130 |
).then(
|
131 |
fn=show_output_box,
|
|
|
25 |
filter_columns.append("property")
|
26 |
# TODO how to sort filter columns alphabetically?
|
27 |
Leaderboard(
|
28 |
+
# TODO(Lood) check that this actually refreshes using the function
|
29 |
value=format_leaderboard_table(df_results=fetch_hf_results(), assay=assay),
|
30 |
datatype=["str", "str", "str", "number"],
|
31 |
select_columns=["model", "property", "spearman", "spearman_cross_val"],
|
|
|
39 |
gr.Markdown("""
|
40 |
## Welcome to the Ginkgo Antibody Developability Benchmark!
|
41 |
|
42 |
+
**Beta version, not publicly launched yet**
|
43 |
+
|
44 |
Participants can submit their model to the leaderboard by uploading a CSV file (see the "✉️ Submit" tab).
|
45 |
See more details in the "❔About" tab.
|
46 |
""")
|
47 |
with gr.Tabs(elem_classes="tab-buttons"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
with gr.TabItem("❔About", elem_id="abdev-benchmark-tab-table"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
gr.Image(
|
50 |
value="./assets/competition_logo.jpg",
|
51 |
show_label=False,
|
52 |
+
# elem_classes=["resized-image"],
|
53 |
show_download_button=False,
|
54 |
+
width="50vw", # 50% of the "viewport width"
|
55 |
)
|
56 |
gr.Markdown(ABOUT_TEXT)
|
57 |
for question, answer in FAQS.items():
|
58 |
with gr.Accordion(question):
|
59 |
gr.Markdown(answer)
|
60 |
+
|
61 |
+
# Procedurally make these 5 tabs
|
62 |
+
for assay in ASSAY_LIST:
|
63 |
+
with gr.TabItem(f"{ASSAY_EMOJIS[assay]} {ASSAY_RENAME[assay]}", elem_id=f"abdev-benchmark-tab-table"):
|
64 |
+
gr.Markdown(f"# {ASSAY_DESCRIPTION[assay]}")
|
65 |
+
get_leaderboard_object(assay=assay)
|
66 |
+
|
67 |
+
with gr.TabItem("🚀 Overall", elem_id="abdev-benchmark-tab-table"):
|
68 |
+
gr.Markdown("# Antibody Developability Benchmark Leaderboard over all properties")
|
69 |
+
get_leaderboard_object()
|
70 |
|
71 |
with gr.TabItem("✉️ Submit", elem_id="boundary-benchmark-tab-table"):
|
72 |
gr.Markdown(
|
73 |
"""
|
74 |
# Antibody Developability Submission
|
75 |
Upload a CSV to get a score!
|
76 |
+
|
77 |
+
Please use your Hugging Face account name to submit your model - we use this to track separate submissions, but only Hugging Face/Ginkgo will see these usernames (unless you choose to make them public).
|
78 |
+
Your submission will be evaluated and added to the leaderboard.
|
79 |
"""
|
80 |
)
|
81 |
filename = gr.State(value=None)
|
|
|
83 |
user_state = gr.State(value=None)
|
84 |
anonymous_state = gr.State(value=False)
|
85 |
|
86 |
+
login_button = gr.LoginButton(value="Sign in with Hugging Face to see account name") # Note(Lood): Is this mandatory?
|
87 |
|
88 |
with gr.Row():
|
89 |
with gr.Column():
|
|
|
93 |
info="This will be displayed on the leaderboard."
|
94 |
)
|
95 |
|
96 |
+
anonymous_checkbox = gr.Checkbox(label="Would you like to keep your submission anonymous?") # Can make this ticked by default
|
97 |
with gr.Column():
|
98 |
+
submission_file = gr.File(label="Submission CSV")
|
99 |
|
100 |
+
# TODO(Lood): How do we get the username from the login button instead? Do we want this?
|
101 |
username_input.change(
|
102 |
fn=lambda x: x if x.strip() else None,
|
103 |
inputs=username_input,
|
|
|
111 |
|
112 |
submit_btn.click(
|
113 |
make_submission,
|
114 |
+
inputs=[submission_file, user_state, anonymous_state],
|
115 |
outputs=[message],
|
116 |
).then(
|
117 |
fn=show_output_box,
|
requirements.txt
CHANGED
@@ -2,4 +2,5 @@ gradio
|
|
2 |
datasets
|
3 |
huggingface_hub
|
4 |
gradio-leaderboard
|
|
|
5 |
# plotly
|
|
|
2 |
datasets
|
3 |
huggingface_hub
|
4 |
gradio-leaderboard
|
5 |
+
gradio[oauth]
|
6 |
# plotly
|
submit.py
CHANGED
@@ -24,13 +24,14 @@ def make_submission(
|
|
24 |
|
25 |
path_obj = Path(file_path)
|
26 |
timestamp = datetime.utcnow().isoformat()
|
27 |
-
submission_id = uuid.uuid4()
|
28 |
|
29 |
with (path_obj.open("rb") as f_in):
|
30 |
file_content = f_in.read().decode("utf-8")
|
31 |
|
32 |
# write to dataset
|
33 |
filename = f"{submission_id}.json"
|
|
|
34 |
record = {
|
35 |
"submission_id": submission_id,
|
36 |
"submission_filename": filename,
|
|
|
24 |
|
25 |
path_obj = Path(file_path)
|
26 |
timestamp = datetime.utcnow().isoformat()
|
27 |
+
submission_id = str(uuid.uuid4())
|
28 |
|
29 |
with (path_obj.open("rb") as f_in):
|
30 |
file_content = f_in.read().decode("utf-8")
|
31 |
|
32 |
# write to dataset
|
33 |
filename = f"{submission_id}.json"
|
34 |
+
# Note: This may be represented as Parquet in the future, so the schema needs to stay consistent
|
35 |
record = {
|
36 |
"submission_id": submission_id,
|
37 |
"submission_filename": filename,
|