Spaces:
Sleeping
Sleeping
matanninio
commited on
Commit
•
83811e8
1
Parent(s):
85690e2
fixed bad sting in PPI demo, moved to IBM theme for the colors
Browse files- app.py +24 -13
- mammal_demo/ppi_task.py +1 -1
app.py
CHANGED
@@ -58,24 +58,34 @@ def create_application():
|
|
58 |
*visibility,
|
59 |
)
|
60 |
else:
|
61 |
-
return (gr.
|
62 |
-
|
|
|
|
|
63 |
|
64 |
-
with gr.Blocks() as application:
|
65 |
task_dropdown = gr.Dropdown(
|
66 |
choices=["Select task"] + list(all_tasks.keys()), label="Mammal Task"
|
67 |
)
|
68 |
task_dropdown.interactive = True
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
task_dropdown.change(
|
81 |
task_change,
|
@@ -86,6 +96,7 @@ def create_application():
|
|
86 |
for task in all_tasks
|
87 |
],
|
88 |
)
|
|
|
89 |
|
90 |
# def set_demo_vis(main_text):
|
91 |
# main_text=main_text
|
|
|
58 |
*visibility,
|
59 |
)
|
60 |
else:
|
61 |
+
return (gr.update(visible=False), *visibility)
|
62 |
+
|
63 |
+
def model_change(value):
|
64 |
+
return gr.update(link=f"https://huggingface.co/{value}",visible=True)
|
65 |
|
66 |
+
with gr.Blocks(theme="Zarkel/IBM_Carbon_Theme") as application:
|
67 |
task_dropdown = gr.Dropdown(
|
68 |
choices=["Select task"] + list(all_tasks.keys()), label="Mammal Task"
|
69 |
)
|
70 |
task_dropdown.interactive = True
|
71 |
+
with gr.Row() :
|
72 |
+
model_name_dropdown = gr.Dropdown(
|
73 |
+
choices=[
|
74 |
+
model_name
|
75 |
+
for model_name, model in all_models.items()
|
76 |
+
if task_dropdown.value in model.tasks
|
77 |
+
],
|
78 |
+
interactive=True,
|
79 |
+
label="Matching Mammal models",
|
80 |
+
visible=False,
|
81 |
+
scale=10,
|
82 |
+
)
|
83 |
+
goto_card_button = gr.Button("Link to model card",size='sm',scale=0,visible=False)
|
84 |
+
model_name_dropdown.change(
|
85 |
+
model_change,
|
86 |
+
inputs=[model_name_dropdown],
|
87 |
+
outputs=[goto_card_button]
|
88 |
+
)
|
89 |
|
90 |
task_dropdown.change(
|
91 |
task_change,
|
|
|
96 |
for task in all_tasks
|
97 |
],
|
98 |
)
|
99 |
+
|
100 |
|
101 |
# def set_demo_vis(main_text):
|
102 |
# main_text=main_text
|
mammal_demo/ppi_task.py
CHANGED
@@ -19,7 +19,7 @@ class PpiTask(MammalTask):
|
|
19 |
"protein_calmodulin": "MADQLTEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMISELDQDGFIDKEDLHDGDGKISFEEFLNLVNKEMTADVDGDGQVNYEEFVTMMTSK",
|
20 |
"protein_calcineurin": "MSSKLLLAGLDIERVLAEKNFYKEWDTWIIEAMNVGDEEVDRIKEFKEDEIFEEAKTLGTAEMQEYKKQKLEEAIEGAFDIFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIRQMWDQNGDWDRIKELKFGEIKKLSAKDTRGTIFIKVFENLGTGVDSEYEDVSKYMLKHQ",
|
21 |
}
|
22 |
-
self.markup_text = """
|
23 |
# Mammal based {self.description} demonstration
|
24 |
|
25 |
Given two protein sequences, estimate if the proteins interact or not."""
|
|
|
19 |
"protein_calmodulin": "MADQLTEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMISELDQDGFIDKEDLHDGDGKISFEEFLNLVNKEMTADVDGDGQVNYEEFVTMMTSK",
|
20 |
"protein_calcineurin": "MSSKLLLAGLDIERVLAEKNFYKEWDTWIIEAMNVGDEEVDRIKEFKEDEIFEEAKTLGTAEMQEYKKQKLEEAIEGAFDIFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIRQMWDQNGDWDRIKELKFGEIKKLSAKDTRGTIFIKVFENLGTGVDSEYEDVSKYMLKHQ",
|
21 |
}
|
22 |
+
self.markup_text = f"""
|
23 |
# Mammal based {self.description} demonstration
|
24 |
|
25 |
Given two protein sequences, estimate if the proteins interact or not."""
|