Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,49 @@
|
|
| 1 |
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
print("===
|
| 4 |
|
| 5 |
-
import
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
return f"Hello {name}!"
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
inputs="text",
|
| 14 |
-
outputs="text",
|
| 15 |
-
title="CVE Analysis Agent - Test"
|
| 16 |
-
)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
if __name__ == "__main__":
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 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)
|