25 lines
728 B
Python
25 lines
728 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
sys.path.insert(0, 'backend')
|
|
|
|
import asyncio
|
|
from services.ollama_service import OllamaService
|
|
|
|
async def test():
|
|
service = OllamaService()
|
|
available = await service.is_available()
|
|
print(f'Ollama available: {available}')
|
|
|
|
if available:
|
|
text = '''Lily asked, "Have you guys heard about the new stream?"
|
|
Benny's eyes lit up. "Ooh, I love streams!"
|
|
Sammy nodded enthusiastically. "I've been wanting to explore!"'''
|
|
|
|
print(f'\nTesting with sample text ({len(text)} chars)...')
|
|
speakers = await service.detect_speakers(text)
|
|
print(f'Detected speakers: {speakers}')
|
|
else:
|
|
print('Ollama is not available!')
|
|
|
|
asyncio.run(test())
|