ChienChung commited on
Commit
779c0e4
Β·
verified Β·
1 Parent(s): 353c70f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -16
app.py CHANGED
@@ -1,23 +1,49 @@
1
  #!/usr/bin/env python3
 
 
 
 
2
 
3
- print("=== App.py is running ===")
4
 
5
- import gradio as gr
 
6
 
7
- def hello(name):
8
- return f"Hello {name}!"
9
 
10
- # Create simple interface
11
- interface = gr.Interface(
12
- fn=hello,
13
- inputs="text",
14
- outputs="text",
15
- title="CVE Analysis Agent - Test"
16
- )
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  if __name__ == "__main__":
19
- print("Launching interface...")
20
- interface.launch(
21
- server_name="0.0.0.0",
22
- server_port=7860
23
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/usr/bin/env python3
2
+ """
3
+ HuggingFace Spaces deployment file
4
+ This file is specifically for deploying to HuggingFace Spaces
5
+ """
6
 
7
+ print("=== Starting CVE Analysis Agent ===")
8
 
9
+ import os
10
+ import sys
11
 
12
+ print("βœ… Basic imports successful")
 
13
 
14
+ # Add current directory to path
15
+ sys.path.append('.')
16
+ print("βœ… Path setup complete")
 
 
 
 
17
 
18
+ # Test each import individually
19
+ try:
20
+ print("πŸ“¦ Testing web_ui import...")
21
+ from web_ui import interface
22
+ print("βœ… web_ui import successful")
23
+ except Exception as e:
24
+ print(f"❌ web_ui import failed: {e}")
25
+ import traceback
26
+ traceback.print_exc()
27
+ sys.exit(1)
28
+
29
+ print("πŸš€ All imports successful, launching interface...")
30
+
31
+ # Launch the interface
32
  if __name__ == "__main__":
33
+ try:
34
+ print("🌐 Starting Gradio interface...")
35
+ interface.launch(
36
+ server_name="0.0.0.0",
37
+ server_port=7860,
38
+ share=False,
39
+ show_error=True,
40
+ # HuggingFace specific settings
41
+ enable_queue=True,
42
+ show_api=False
43
+ )
44
+ print("βœ… Interface launched successfully!")
45
+ except Exception as e:
46
+ print(f"❌ Launch failed: {e}")
47
+ import traceback
48
+ traceback.print_exc()
49
+ sys.exit(1)