File size: 1,630 Bytes
be31546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
"""
Test script to verify that VERSA is installed correctly.
"""

import os
import sys
import subprocess
from pathlib import Path

# Check if VERSA is installed
VERSA_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "versa")

def check_versa():
    """Check if VERSA is installed and working"""
    print("Testing VERSA installation...")
    
    if not os.path.exists(VERSA_ROOT):
        print("VERSA not found.")
        return False
    
    # Check if the scorer.py exists
    scorer_path = os.path.join(VERSA_ROOT, "versa", "bin", "scorer.py")
    if not os.path.exists(scorer_path):
        print(f"VERSA scorer not found at {scorer_path}")
        return False
    
    # Check if the config directory exists
    config_dir = os.path.join(VERSA_ROOT, "egs")
    if not os.path.exists(config_dir):
        print(f"VERSA config directory not found at {config_dir}")
        return False
    
    # Check for available metrics
    metrics = []
    for root, _, files in os.walk(config_dir):
        for file in files:
            if file.endswith('.yaml'):
                metrics.append(os.path.join(root, file))
    
    if not metrics:
        print("No metric configurations found in VERSA.")
        return False
    
    print(f"Found {len(metrics)} metric configurations.")
    for metric in metrics[:5]:  # Print first 5 metrics
        print(f"- {os.path.relpath(metric, config_dir)}")
    
    if len(metrics) > 5:
        print(f"... and {len(metrics) - 5} more.")
    
    print("VERSA installation looks good!")
    return True

if __name__ == "__main__":
    check_versa()