|
import sys |
|
import os |
|
|
|
print("Starting test...") |
|
|
|
|
|
try: |
|
import gradio as gr |
|
import whisper |
|
import random |
|
import time |
|
from utils import SocialGraphManager, SuggestionGenerator |
|
print("All modules imported successfully") |
|
except Exception as e: |
|
print(f"Error importing modules: {e}") |
|
sys.exit(1) |
|
|
|
|
|
try: |
|
social_graph = SocialGraphManager("social_graph.json") |
|
print("Social graph loaded successfully") |
|
except Exception as e: |
|
print(f"Error loading social graph: {e}") |
|
sys.exit(1) |
|
|
|
|
|
try: |
|
suggestion_generator = SuggestionGenerator("distilgpt2") |
|
print("Suggestion generator initialized successfully") |
|
except Exception as e: |
|
print(f"Error initializing suggestion generator: {e}") |
|
sys.exit(1) |
|
|
|
|
|
try: |
|
people = social_graph.get_people_list() |
|
print(f"Found {len(people)} people in the social graph") |
|
if people: |
|
print(f"First person: {people[0]['name']} ({people[0]['role']})") |
|
except Exception as e: |
|
print(f"Error getting people from social graph: {e}") |
|
sys.exit(1) |
|
|
|
|
|
try: |
|
if people: |
|
person_id = people[0]['id'] |
|
person_context = social_graph.get_person_context(person_id) |
|
print(f"Got context for {person_context.get('name', 'unknown')}") |
|
except Exception as e: |
|
print(f"Error getting person context: {e}") |
|
sys.exit(1) |
|
|
|
print("All tests passed successfully!") |
|
|