Spaces:
Paused
Paused
File size: 1,141 Bytes
d8328bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
"""Minimal test to verify the agent can load and generate text."""
from __future__ import annotations
import sys
from pathlib import Path
# Add project root to Python path
project_root = Path(__file__).resolve().parents[1]
if str(project_root) not in sys.path:
sys.path.insert(0, str(project_root))
from agent.client_llm import Message, NexaSciModelClient
def main() -> None:
"""Run a minimal generation test."""
print("Loading NexaSci model...")
try:
client = NexaSciModelClient()
print("✓ Model loaded successfully")
except Exception as e:
print(f"✗ Failed to load model: {e}")
return
print("\nTesting generation with a simple prompt...")
messages = [
Message(role="user", content="What is 2+2? Answer briefly.")
]
try:
response = client.generate(messages, max_new_tokens=50)
print(f"✓ Generation successful!")
print(f"\nResponse: {response}")
except Exception as e:
print(f"✗ Generation failed: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
main()
|