shyamsridhar123 commited on
Commit
3cbdf62
·
1 Parent(s): d716662

Fix Gradio version to 4.36.1 and resolve localhost launch issue

Browse files
Files changed (3) hide show
  1. README.md +4 -4
  2. requirements.txt +1 -1
  3. space_app.py +16 -17
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  title: SkillSprout - MCP Hackathon 2025
3
- emoji: 🌱
4
- colorFrom: green
5
- colorTo: blue
6
  sdk: gradio
7
- sdk_version: 4.44.0
8
  app_file: space_app.py
9
  pinned: false
10
  license: mit
 
1
  ---
2
  title: SkillSprout - MCP Hackathon 2025
3
+ emoji: 🚀
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.36.1
8
  app_file: space_app.py
9
  pinned: false
10
  license: mit
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio>=4.36.1
2
  openai>=1.12.0
3
  python-dotenv>=1.0.0
4
  pandas>=2.0.0
 
1
+ gradio==4.36.1
2
  openai>=1.12.0
3
  python-dotenv>=1.0.0
4
  pandas>=2.0.0
space_app.py CHANGED
@@ -806,23 +806,22 @@ def run_mcp_server():
806
  )
807
 
808
  def main():
809
- """Main application entry point for Hugging Face Spaces"""
810
- # Start MCP server in background thread
811
- mcp_thread = threading.Thread(target=run_mcp_server, daemon=True)
812
- mcp_thread.start()
813
-
814
- # Give MCP server time to start
815
- time.sleep(2)
816
-
817
- # Create and launch Gradio interface
818
- demo = create_interface()
819
- # For Hugging Face Spaces, we should not set share=True
820
- # Also ensure we're not setting any problematic launch parameters
821
- demo.launch(
822
- server_name="0.0.0.0",
823
- server_port=7860,
824
- share=False # Changed from True to False for HF Spaces
825
- )
826
 
827
  if __name__ == "__main__":
828
  main()
 
806
  )
807
 
808
  def main():
809
+ """Main function to launch the Gradio interface."""
810
+ try:
811
+ demo = create_interface()
812
+
813
+ # For Hugging Face Spaces, we need specific launch parameters
814
+ demo.launch(
815
+ server_name="0.0.0.0", # Allow external connections
816
+ server_port=7860, # HF Spaces default port
817
+ share=False, # Don't create public link on HF Spaces
818
+ show_error=True, # Show errors in the UI
819
+ debug=False # Disable debug mode in production
820
+ )
821
+ except Exception as e:
822
+ print(f"Error launching app: {e}")
823
+ # Fallback launch configuration
824
+ demo.launch()
 
825
 
826
  if __name__ == "__main__":
827
  main()