Spaces:
Runtime error
Runtime error
#!/usr/bin/env python3 | |
""" | |
Test the enhanced upload.py with Ollama integration | |
""" | |
from upload import EnhancedDataExplorer | |
def test_enhanced_explorer(): | |
print("π Testing Enhanced Data Explorer with Ollama...") | |
try: | |
# Initialize the explorer | |
explorer = EnhancedDataExplorer() | |
# Check status | |
print("\nπ Checking system status:") | |
explorer.check_status() | |
# Load data | |
print("\nπ Loading data:") | |
data = explorer.load_data() | |
if data is not None: | |
print(f"β Data loaded successfully: {data.shape}") | |
# Test AI analysis if agent is available | |
if explorer.agent is not None: | |
print("\nπ€ Testing AI analysis:") | |
response = explorer.ai_analysis("What are the main log levels in this data?") | |
if response: | |
print("β AI analysis completed successfully!") | |
else: | |
print("β οΈ AI analysis returned no response") | |
else: | |
print("β No AI agent configured") | |
else: | |
print("β Failed to load data") | |
except Exception as e: | |
print(f"β Test failed: {e}") | |
import traceback | |
traceback.print_exc() | |
if __name__ == "__main__": | |
test_enhanced_explorer() | |