all_test.py 894 Bytes
Newer Older
wangkx1's avatar
init  
wangkx1 committed
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
# all_test.py
#!/usr/bin/env python3
import yaml
import os
import sys

# 添加当前目录到Python路径
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from env import Environment
from scripts.model_runner import ModelRunner

def load_config():
    """加载配置文件"""
    config_file = "config/base.yaml"
    
    if not os.path.exists(config_file):
        print(f"错误: 配置文件不存在: {config_file}")
        sys.exit(1)
    
    with open(config_file, 'r') as f:
        return yaml.safe_load(f)

def main():
    """主函数"""
    
    print("开始运行模型性能测试...")
    
    # 加载配置
    config = load_config()
    
    # 初始化环境
    env = Environment(config)
    
    # 初始化模型运行器
    runner = ModelRunner(config, env)
    
    # 运行所有模型
    runner.run_all_models()

if __name__ == "__main__":
    main()