Spaces:
Sleeping
Sleeping
matanninio
commited on
Commit
•
62efb75
1
Parent(s):
83811e8
tcr is back online
Browse files
app.py
CHANGED
@@ -19,8 +19,7 @@ all_models = ModelRegistry()
|
|
19 |
ppi_task = all_tasks.register_task(PpiTask(model_dict=all_models))
|
20 |
tdi_task = all_tasks.register_task(DtiTask(model_dict=all_models))
|
21 |
ps_task = all_tasks.register_task(PsTask(model_dict=all_models))
|
22 |
-
|
23 |
-
tcr_task = "not ready yet"
|
24 |
|
25 |
# create the model holders. hold the model and the tokenizer, lazy download
|
26 |
# note that the list of relevent tasks needs to be stated.
|
@@ -38,11 +37,18 @@ all_models.register_model(
|
|
38 |
)
|
39 |
all_models.register_model(
|
40 |
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m",
|
41 |
-
task_list=[ppi_task
|
42 |
)
|
43 |
-
all_models.register_model(
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
def create_application():
|
48 |
def task_change(value):
|
@@ -59,16 +65,16 @@ def create_application():
|
|
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
|
@@ -80,11 +86,11 @@ def create_application():
|
|
80 |
visible=False,
|
81 |
scale=10,
|
82 |
)
|
83 |
-
goto_card_button = gr.Button(
|
|
|
|
|
84 |
model_name_dropdown.change(
|
85 |
-
model_change,
|
86 |
-
inputs=[model_name_dropdown],
|
87 |
-
outputs=[goto_card_button]
|
88 |
)
|
89 |
|
90 |
task_dropdown.change(
|
@@ -96,7 +102,6 @@ def create_application():
|
|
96 |
for task in all_tasks
|
97 |
],
|
98 |
)
|
99 |
-
|
100 |
|
101 |
# def set_demo_vis(main_text):
|
102 |
# main_text=main_text
|
|
|
19 |
ppi_task = all_tasks.register_task(PpiTask(model_dict=all_models))
|
20 |
tdi_task = all_tasks.register_task(DtiTask(model_dict=all_models))
|
21 |
ps_task = all_tasks.register_task(PsTask(model_dict=all_models))
|
22 |
+
tcr_task = all_tasks.register_task(TcrTask(model_dict=all_models))
|
|
|
23 |
|
24 |
# create the model holders. hold the model and the tokenizer, lazy download
|
25 |
# note that the list of relevent tasks needs to be stated.
|
|
|
37 |
)
|
38 |
all_models.register_model(
|
39 |
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m",
|
40 |
+
task_list=[ppi_task],
|
41 |
)
|
42 |
+
all_models.register_model(
|
43 |
+
"https://huggingface.co/ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_tox"
|
44 |
+
)
|
45 |
+
all_models.register_model(
|
46 |
+
"https://huggingface.co/ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_fda"
|
47 |
+
)
|
48 |
+
all_models.register_model(
|
49 |
+
"https://huggingface.co/ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_bbbp"
|
50 |
+
)
|
51 |
+
|
52 |
|
53 |
def create_application():
|
54 |
def task_change(value):
|
|
|
65 |
)
|
66 |
else:
|
67 |
return (gr.update(visible=False), *visibility)
|
68 |
+
|
69 |
def model_change(value):
|
70 |
+
return gr.update(link=f"https://huggingface.co/{value}", visible=True)
|
71 |
|
72 |
with gr.Blocks(theme="Zarkel/IBM_Carbon_Theme") as application:
|
73 |
task_dropdown = gr.Dropdown(
|
74 |
choices=["Select task"] + list(all_tasks.keys()), label="Mammal Task"
|
75 |
)
|
76 |
task_dropdown.interactive = True
|
77 |
+
with gr.Row():
|
78 |
model_name_dropdown = gr.Dropdown(
|
79 |
choices=[
|
80 |
model_name
|
|
|
86 |
visible=False,
|
87 |
scale=10,
|
88 |
)
|
89 |
+
goto_card_button = gr.Button(
|
90 |
+
"Link to model card", size="sm", scale=0, visible=False
|
91 |
+
)
|
92 |
model_name_dropdown.change(
|
93 |
+
model_change, inputs=[model_name_dropdown], outputs=[goto_card_button]
|
|
|
|
|
94 |
)
|
95 |
|
96 |
task_dropdown.change(
|
|
|
102 |
for task in all_tasks
|
103 |
],
|
104 |
)
|
|
|
105 |
|
106 |
# def set_demo_vis(main_text):
|
107 |
# main_text=main_text
|