|
|
|
|
|
import torch |
|
|
from model import AcoliModel |
|
|
import json |
|
|
|
|
|
def test_model(): |
|
|
|
|
|
print("Loading Acoli model...") |
|
|
model = AcoliModel("./acoli-model") |
|
|
|
|
|
|
|
|
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}") |
|
|
|
|
|
|
|
|
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() |