re-type commited on
Commit
fc9d32d
·
verified ·
1 Parent(s): cb1d704

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -26
app.py CHANGED
@@ -833,15 +833,11 @@ def create_interface():
833
  }
834
  """
835
 
836
- with gr.Blocks(css=custom_css, title="🧬 Advanced Gene Analysis Pipeline", theme=gr.themes.Soft()) as iface:
837
-
838
- # Header
839
- gr.HTML("""
840
- <div style="text-align: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 15px; margin-bottom: 20px;">
841
- <h1 style="color: white; margin: 0; font-size: 2.5em; font-weight: 700;">🧬 Advanced Gene Analysis Pipeline</h1>
842
- <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0; font-size: 1.2em;">F Gene Boundary Detection • Validation • Phylogenetic Analysis</p>
843
- </div>
844
- """)
845
 
846
  # Instructions
847
  with gr.Accordion("📋 Instructions & Information", open=False):
@@ -1007,7 +1003,8 @@ def create_interface():
1007
  tree_file,
1008
  html_tree_file,
1009
  tree_html_display
1010
- ]
 
1011
  )
1012
 
1013
  analyze_file_btn.click(
@@ -1023,11 +1020,11 @@ def create_interface():
1023
  tree_file,
1024
  html_tree_file,
1025
  tree_html_display
1026
- ]
 
1027
  )
1028
 
1029
  return iface
1030
-
1031
  # --- Main Execution ---
1032
  if __name__ == "__main__":
1033
  try:
@@ -1051,25 +1048,15 @@ if __name__ == "__main__":
1051
  print("\n🚀 Starting Gradio interface...")
1052
 
1053
  # Create and launch interface
1054
- iface = create_interface()
1055
- # Expose minimal API for programmatic use
1056
- api_interface = gr.Interface(
1057
- fn=run_pipeline,
1058
- inputs=[gr.Textbox(), gr.Slider(), gr.Checkbox()],
1059
- outputs=[gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.File(), gr.File(), gr.File(), gr.HTML()]
1060
- )
1061
-
1062
- iface.launch(
1063
- iface.launch(
1064
  share=False,
1065
  server_name="0.0.0.0",
1066
  server_port=7860,
1067
  show_error=True,
1068
- api=True # This enables /run/predict
1069
- )
1070
- )
1071
  )
1072
-
1073
  except Exception as e:
1074
  logging.error(f"Failed to start application: {e}")
1075
  import traceback
 
833
  }
834
  """
835
 
836
+ with gr.Blocks(
837
+ css=custom_css,
838
+ title="🧬 Advanced Gene Analysis Pipeline",
839
+ theme=gr.themes.Soft()
840
+ ) as iface:
 
 
 
 
841
 
842
  # Instructions
843
  with gr.Accordion("📋 Instructions & Information", open=False):
 
1003
  tree_file,
1004
  html_tree_file,
1005
  tree_html_display
1006
+ ],
1007
+ api_name="analyze_text" # ADD THIS LINE
1008
  )
1009
 
1010
  analyze_file_btn.click(
 
1020
  tree_file,
1021
  html_tree_file,
1022
  tree_html_display
1023
+ ],
1024
+ api_name="analyze_file" # ADD THIS LINE
1025
  )
1026
 
1027
  return iface
 
1028
  # --- Main Execution ---
1029
  if __name__ == "__main__":
1030
  try:
 
1048
  print("\n🚀 Starting Gradio interface...")
1049
 
1050
  # Create and launch interface
1051
+ iface = create_interface()
1052
+ iface.launch(
 
 
 
 
 
 
 
 
1053
  share=False,
1054
  server_name="0.0.0.0",
1055
  server_port=7860,
1056
  show_error=True,
1057
+ enable_api=True # ADD THIS LINE - explicitly enable API
 
 
1058
  )
1059
+
1060
  except Exception as e:
1061
  logging.error(f"Failed to start application: {e}")
1062
  import traceback