Spaces:
Running
Running
Commit
·
e1d6be0
1
Parent(s):
826f64e
add more functions
Browse files
app.py
CHANGED
@@ -445,7 +445,8 @@ iface = gr.Interface(
|
|
445 |
),
|
446 |
gr.File(
|
447 |
label="Or upload a text file with SMILES",
|
448 |
-
file_types=[".txt"]
|
|
|
449 |
),
|
450 |
gr.Checkbox(
|
451 |
label="Show linear representation"
|
@@ -475,26 +476,23 @@ iface = gr.Interface(
|
|
475 |
Input: Either enter a SMILES string directly or upload a text file
|
476 |
""",
|
477 |
examples=[
|
478 |
-
# Only include the SMILES string and checkbox inputs in examples
|
479 |
[
|
480 |
"CC(C)C[C@@H]1NC(=O)[C@@H]2CCCN2C(=O)[C@@H](CC(C)C)NC(=O)[C@@H](CC(C)C)N(C)C(=O)[C@H](C)NC(=O)[C@H](Cc2ccccc2)NC1=O",
|
481 |
-
|
482 |
-
True
|
483 |
],
|
484 |
[
|
485 |
"CC(C)C[C@@H]1OC(=O)[C@H](C)NC(=O)[C@H](C(C)C)OC(=O)[C@H](C)N(C)C(=O)[C@@H](C)NC(=O)[C@@H](Cc2ccccc2)N(C)C1=O",
|
486 |
-
|
487 |
-
True
|
488 |
]
|
489 |
],
|
490 |
-
flagging_mode="never"
|
491 |
-
allow_flagging="never" # Disable flagging completely
|
492 |
)
|
493 |
|
494 |
-
# Launch the app
|
495 |
if __name__ == "__main__":
|
496 |
iface.launch(
|
497 |
-
|
498 |
-
|
499 |
-
server_port=7860 # Default Gradio port
|
500 |
)
|
|
|
445 |
),
|
446 |
gr.File(
|
447 |
label="Or upload a text file with SMILES",
|
448 |
+
file_types=[".txt"],
|
449 |
+
optional=True # Make the file input optional
|
450 |
),
|
451 |
gr.Checkbox(
|
452 |
label="Show linear representation"
|
|
|
476 |
Input: Either enter a SMILES string directly or upload a text file
|
477 |
""",
|
478 |
examples=[
|
|
|
479 |
[
|
480 |
"CC(C)C[C@@H]1NC(=O)[C@@H]2CCCN2C(=O)[C@@H](CC(C)C)NC(=O)[C@@H](CC(C)C)N(C)C(=O)[C@H](C)NC(=O)[C@H](Cc2ccccc2)NC1=O",
|
481 |
+
gr.File.update(visible=False), # Hide file input in examples
|
482 |
+
True
|
483 |
],
|
484 |
[
|
485 |
"CC(C)C[C@@H]1OC(=O)[C@H](C)NC(=O)[C@H](C(C)C)OC(=O)[C@H](C)N(C)C(=O)[C@@H](C)NC(=O)[C@@H](Cc2ccccc2)N(C)C1=O",
|
486 |
+
gr.File.update(visible=False), # Hide file input in examples
|
487 |
+
True
|
488 |
]
|
489 |
],
|
490 |
+
flagging_mode="never"
|
|
|
491 |
)
|
492 |
|
493 |
+
# Launch the app
|
494 |
if __name__ == "__main__":
|
495 |
iface.launch(
|
496 |
+
server_name="0.0.0.0",
|
497 |
+
server_port=7860
|
|
|
498 |
)
|