Spaces:
Configuration error
Configuration error
File size: 977 Bytes
bec06d9 |
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 |
import asyncio
from embedder import Embedder
async def test_embedding():
"""Test embedding functionality only."""
print("Testing embedding functionality...")
try:
embedder = Embedder()
print("[OK] Embedder initialized successfully")
# Test creating a single embedding
test_text = "This is a test sentence for embedding."
embedding = await embedder.create_embedding(test_text)
print(f"[OK] Embedding created successfully. Dimension: {len(embedding)}")
print(f"[OK] First 5 values: {embedding[:5]}")
return True
except Exception as e:
print(f"[ERROR] Embedding test failed: {str(e)}")
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
success = asyncio.run(test_embedding())
if success:
print("\nEmbedding test completed successfully!")
else:
print("\nEmbedding test failed.") |