Acoli / test.py
prelington's picture
Create test.py
aa2ebcd verified
#!/usr/bin/env python3
import torch
from model import AcoliModel
import json
def test_model():
# Load your trained model
print("Loading Acoli model...")
model = AcoliModel("./acoli-model") # Path to your trained model
# Test with some sample Acoli text
test_texts = [
"Acoli dwog ma con gi twero nwongo piny i ceng lok.",
"Lapwony opoto i kom yat ma opore i wi dogola.",
"Pii ma okelo ngom ma tye ka dwaro lweny i kom dano.",
"Kit ma gitye ka twero bedo ki dano ma opore i wi piny."
]
print("\n=== Testing Acoli Model ===")
for i, text in enumerate(test_texts, 1):
print(f"\nTest {i}:")
print(f"Input: {text}")
prediction = model.predict(text)
print(f"Prediction: {prediction}")
# Get model info
print(f"\n=== Model Information ===")
info = model.get_model_info()
print(f"Model type: {info['model_type']}")
print(f"Number of parameters: {info['num_parameters']:,}")
print(f"Model path: {info['model_path']}")
if __name__ == "__main__":
test_model()