Spaces:
Sleeping
Sleeping
vladimir.manuylov
commited on
Commit
·
296764f
1
Parent(s):
bea5b09
fixing empty seq bug using gr.update
Browse files
app.py
CHANGED
|
@@ -65,7 +65,7 @@ def generate_smiles_for_sequence(protein_sequence: str, num_samples: int, reques
|
|
| 65 |
return ",\n".join(unique_smiles)
|
| 66 |
|
| 67 |
def enable_btn(seq: str):
|
| 68 |
-
return gr.
|
| 69 |
|
| 70 |
|
| 71 |
def log_run(client_ip: str, seq: str):
|
|
@@ -172,7 +172,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 172 |
*Model developed by Gero AI. For more details, check out the [original repository](https://github.com/gero-science/ProtoBind-Diff).*
|
| 173 |
"""
|
| 174 |
)
|
| 175 |
-
protein_sequence.
|
| 176 |
|
| 177 |
submit_btn.click(
|
| 178 |
fn=generate_smiles_for_sequence,
|
|
|
|
| 65 |
return ",\n".join(unique_smiles)
|
| 66 |
|
| 67 |
def enable_btn(seq: str):
|
| 68 |
+
return gr.update(interactive=len(seq) >= 10)
|
| 69 |
|
| 70 |
|
| 71 |
def log_run(client_ip: str, seq: str):
|
|
|
|
| 172 |
*Model developed by Gero AI. For more details, check out the [original repository](https://github.com/gero-science/ProtoBind-Diff).*
|
| 173 |
"""
|
| 174 |
)
|
| 175 |
+
protein_sequence.input(enable_btn, inputs=protein_sequence, outputs=submit_btn)
|
| 176 |
|
| 177 |
submit_btn.click(
|
| 178 |
fn=generate_smiles_for_sequence,
|