Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,44 +4,41 @@ 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("
|
| 13 |
|
| 14 |
# Add current directory to path
|
| 15 |
sys.path.append('.')
|
| 16 |
-
print("
|
| 17 |
|
| 18 |
# Test each import individually
|
| 19 |
try:
|
| 20 |
-
print("
|
| 21 |
from web_ui import interface
|
| 22 |
-
print("
|
| 23 |
except Exception as e:
|
| 24 |
-
print(f"
|
| 25 |
import traceback
|
| 26 |
traceback.print_exc()
|
| 27 |
sys.exit(1)
|
| 28 |
|
| 29 |
-
print("
|
| 30 |
|
| 31 |
# Launch the interface
|
| 32 |
if __name__ == "__main__":
|
| 33 |
try:
|
| 34 |
-
print("
|
| 35 |
interface.launch(
|
| 36 |
server_name="0.0.0.0",
|
| 37 |
server_port=7860,
|
| 38 |
share=False,
|
| 39 |
show_error=True
|
| 40 |
-
# 移除過時的參數:enable_queue, show_api
|
| 41 |
)
|
| 42 |
-
print("
|
| 43 |
except Exception as e:
|
| 44 |
-
print(f"
|
| 45 |
import traceback
|
| 46 |
traceback.print_exc()
|
| 47 |
sys.exit(1)
|
|
|
|
| 4 |
This file is specifically for deploying to HuggingFace Spaces
|
| 5 |
"""
|
| 6 |
|
|
|
|
|
|
|
| 7 |
import os
|
| 8 |
import sys
|
| 9 |
|
| 10 |
+
print("Imports successful")
|
| 11 |
|
| 12 |
# Add current directory to path
|
| 13 |
sys.path.append('.')
|
| 14 |
+
print("Path setup complete")
|
| 15 |
|
| 16 |
# Test each import individually
|
| 17 |
try:
|
| 18 |
+
print("Testing web_ui import...")
|
| 19 |
from web_ui import interface
|
| 20 |
+
print("web_ui import successful")
|
| 21 |
except Exception as e:
|
| 22 |
+
print(f"web_ui import failed: {e}")
|
| 23 |
import traceback
|
| 24 |
traceback.print_exc()
|
| 25 |
sys.exit(1)
|
| 26 |
|
| 27 |
+
print("All imports successful, launching interface")
|
| 28 |
|
| 29 |
# Launch the interface
|
| 30 |
if __name__ == "__main__":
|
| 31 |
try:
|
| 32 |
+
print("Starting Gradio interface...")
|
| 33 |
interface.launch(
|
| 34 |
server_name="0.0.0.0",
|
| 35 |
server_port=7860,
|
| 36 |
share=False,
|
| 37 |
show_error=True
|
|
|
|
| 38 |
)
|
| 39 |
+
print("Interface launched successfully!")
|
| 40 |
except Exception as e:
|
| 41 |
+
print(f"Launch failed: {e}")
|
| 42 |
import traceback
|
| 43 |
traceback.print_exc()
|
| 44 |
sys.exit(1)
|