File size: 1,090 Bytes
aa2ebcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/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()