Spaces:
Running
Running
matanninio
commited on
Commit
·
32cc43e
1
Parent(s):
ac117b5
better text and score display fix
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def run_query(query):
|
|
54 |
|
55 |
# Get output
|
56 |
generated_output = tokenizer_op._tokenizer.decode(batch_dict[CLS_PRED][0])
|
57 |
-
score = batch_dict['model.out.scores'][0][1][positive_token_id].item
|
58 |
|
59 |
return generated_output,score
|
60 |
|
@@ -65,7 +65,10 @@ def create_and_run_query(prot1, prot2):
|
|
65 |
|
66 |
def create_application():
|
67 |
markup_text = f"""
|
68 |
-
# Mammal
|
|
|
|
|
|
|
69 |
### Using the model from
|
70 |
|
71 |
```{model_path} ```
|
@@ -89,7 +92,7 @@ def create_application():
|
|
89 |
value=protein_calcineurin,
|
90 |
)
|
91 |
with gr.Row():
|
92 |
-
run_mammal = gr.Button("Run Mammal query")
|
93 |
with gr.Row():
|
94 |
query_box = gr.Textbox(label="Mammal query",lines=5)
|
95 |
|
@@ -98,8 +101,11 @@ def create_application():
|
|
98 |
run_mammal.click(
|
99 |
fn=create_and_run_query,
|
100 |
inputs=[prot1,prot2],
|
101 |
-
outputs=[query_box,decoded,gr.Number(label='
|
102 |
)
|
|
|
|
|
|
|
103 |
return demo
|
104 |
|
105 |
def main():
|
|
|
54 |
|
55 |
# Get output
|
56 |
generated_output = tokenizer_op._tokenizer.decode(batch_dict[CLS_PRED][0])
|
57 |
+
score = batch_dict['model.out.scores'][0][1][positive_token_id].item()
|
58 |
|
59 |
return generated_output,score
|
60 |
|
|
|
65 |
|
66 |
def create_application():
|
67 |
markup_text = f"""
|
68 |
+
# Mammal based Protein-Protein Interaction (PPI) demonstration
|
69 |
+
|
70 |
+
Given two protein sequences, estimate if the proteins interact or not.
|
71 |
+
|
72 |
### Using the model from
|
73 |
|
74 |
```{model_path} ```
|
|
|
92 |
value=protein_calcineurin,
|
93 |
)
|
94 |
with gr.Row():
|
95 |
+
run_mammal = gr.Button("Run Mammal query for Protein-Protein Interaction",variant='primary')
|
96 |
with gr.Row():
|
97 |
query_box = gr.Textbox(label="Mammal query",lines=5)
|
98 |
|
|
|
101 |
run_mammal.click(
|
102 |
fn=create_and_run_query,
|
103 |
inputs=[prot1,prot2],
|
104 |
+
outputs=[query_box,decoded,gr.Number(label='PPI score')]
|
105 |
)
|
106 |
+
with gr.Row():
|
107 |
+
gr.Markdown("```<SENTINEL_ID_0>``` contains the binding affinity class, which is ```<1>``` for interating and ```<0>``` for non-interating")
|
108 |
+
|
109 |
return demo
|
110 |
|
111 |
def main():
|