yinuozhang commited on
Commit
826f64e
·
1 Parent(s): 0f570bc

add more functions

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -435,10 +435,6 @@ def process_input(smiles_input=None, file_obj=None, show_linear=False):
435
 
436
  return "No input provided.", None, None
437
 
438
- # Create Gradio interface
439
- # [Previous imports and functions remain the same]
440
-
441
- # Create Gradio interface with fixed examples
442
  iface = gr.Interface(
443
  fn=process_input,
444
  inputs=[
@@ -479,20 +475,26 @@ iface = gr.Interface(
479
  Input: Either enter a SMILES string directly or upload a text file
480
  """,
481
  examples=[
 
482
  [
483
  "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",
484
- None, # Simply use None for file input in examples
485
- True
486
  ],
487
  [
488
  "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",
489
- None,
490
- True
491
  ]
492
  ],
493
- flagging_mode="never"
 
494
  )
495
 
496
- # Launch the app
497
  if __name__ == "__main__":
498
- iface.launch()
 
 
 
 
 
435
 
436
  return "No input provided.", None, None
437
 
 
 
 
 
438
  iface = gr.Interface(
439
  fn=process_input,
440
  inputs=[
 
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
+ None, # File input should be None
482
+ True # Checkbox value
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
+ None, # File input should be None
487
+ True # Checkbox value
488
  ]
489
  ],
490
+ flagging_mode="never",
491
+ allow_flagging="never" # Disable flagging completely
492
  )
493
 
494
+ # Launch the app with additional configuration
495
  if __name__ == "__main__":
496
+ iface.launch(
497
+ share=False, # Don't create public URL
498
+ server_name="0.0.0.0", # Listen on all interfaces
499
+ server_port=7860 # Default Gradio port
500
+ )