-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_unified_parameters.py
More file actions
74 lines (57 loc) · 2.21 KB
/
Copy pathinit_unified_parameters.py
File metadata and controls
74 lines (57 loc) · 2.21 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
初始化统一的 SSM 参数配置
将所有参数统一到 /driver-hand-detection/config/ 路径下
"""
import sys
import os
import argparse
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
from utils.parameter_manager import ConfigManager
def main():
"""初始化统一配置参数"""
# 解析命令行参数
parser = argparse.ArgumentParser(description='初始化统一的SSM参数配置')
parser.add_argument('--region', default='us-east-1', help='AWS区域')
parser.add_argument('--env', default='config', help='环境名称')
args = parser.parse_args()
print(f"🔧 初始化统一的 SSM 参数配置 (区域: {args.region}, 环境: {args.env})...")
print("=" * 50)
# 创建配置管理器
config_manager = ConfigManager(environment=args.env, region_name=args.region)
# 检查是否为中国区域
is_china_region = args.region.startswith('cn-')
# 初始化默认配置
config_manager.init_default_config()
# 如果是中国区域,设置中国区域特定参数
if is_china_region:
print("\n📋 设置中国区域特定参数:")
print("-" * 30)
# 设置中国区域特定参数
china_params = {
'ai/model_id': 'deepseek-r1',
'api-endpoint': 'https://api.guiji.ai/v1/models',
'monitoring/log_level': 'INFO',
'error/max_retry_attempts': '5', # 增加重试次数
}
for key, value in china_params.items():
config_manager.update_config(key, value)
print(f"✅ {key}: {value}")
print("\n📋 验证关键参数:")
print("-" * 30)
# 验证关键参数
key_params = [
'ai/model_id',
'video/frames_per_segment',
'lambda/concurrency_limit',
'performance/batch_size',
'api-endpoint'
]
for param in key_params:
value = config_manager.get_config(param)
print(f"✅ {param}: {value}")
print("\n🎉 统一参数配置初始化完成!")
print("💡 现在所有参数都使用 /driver-hand-detection/config/ 路径")
if __name__ == "__main__":
main()