积极的屁孩 commited on
Commit
e593e60
·
1 Parent(s): 0a31a84
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -137,7 +137,8 @@ try:
137
  original_config_path,
138
  original_config_path.replace('./models/vc/vevo/config/', './tokenizer/vq32/'),
139
  os.path.join(os.getcwd(), 'tokenizer/vq32/hubert_large_l18_c32.yaml'),
140
- os.path.join(os.getcwd(), 'models/vc/vevo/config/hubert_large_l18_c32.yaml')
 
141
  ]
142
 
143
  # 尝试每个路径
@@ -329,11 +330,26 @@ class VevoGradioApp:
329
  # 获取当前工作目录的绝对路径
330
  base_dir = os.path.abspath(os.getcwd())
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  # 替换配置中的相对路径
333
  if 'representation_stat_mean_var_path' in config_data:
334
- # 正确的统计文件路径
335
- stat_file_path = f"{base_dir}/models/vc/vevo/config/hubert_large_l18_mean_std.npz"
336
-
337
  # 替换所有可能的路径格式
338
  replacements = [
339
  ('"representation_stat_mean_var_path": "./models/vc/vevo/config/hubert_large_l18_mean_std.npz"', f'"representation_stat_mean_var_path": "{stat_file_path}"'),
 
137
  original_config_path,
138
  original_config_path.replace('./models/vc/vevo/config/', './tokenizer/vq32/'),
139
  os.path.join(os.getcwd(), 'tokenizer/vq32/hubert_large_l18_c32.yaml'),
140
+ os.path.join(os.getcwd(), 'models/vc/vevo/config/hubert_large_l18_c32.yaml'),
141
+ os.path.join(os.getcwd(), 'Amphion/models/vc/vevo/config/hubert_large_l18_c32.yaml')
142
  ]
143
 
144
  # 尝试每个路径
 
330
  # 获取当前工作目录的绝对路径
331
  base_dir = os.path.abspath(os.getcwd())
332
 
333
+ # 统计文件的可能路径
334
+ possible_stats = [
335
+ f"{base_dir}/models/vc/vevo/config/hubert_large_l18_mean_std.npz",
336
+ f"{base_dir}/tokenizer/vq32/hubert_large_l18_mean_std.npz",
337
+ f"{base_dir}/Amphion/models/vc/vevo/config/hubert_large_l18_mean_std.npz"
338
+ ]
339
+
340
+ # 找到一个确实存在的文件路径
341
+ stat_file_path = None
342
+ for path in possible_stats:
343
+ if os.path.exists(path):
344
+ stat_file_path = path
345
+ break
346
+
347
+ if not stat_file_path:
348
+ # 如果都不存在,默认使用第一个路径
349
+ stat_file_path = possible_stats[0]
350
+
351
  # 替换配置中的相对路径
352
  if 'representation_stat_mean_var_path' in config_data:
 
 
 
353
  # 替换所有可能的路径格式
354
  replacements = [
355
  ('"representation_stat_mean_var_path": "./models/vc/vevo/config/hubert_large_l18_mean_std.npz"', f'"representation_stat_mean_var_path": "{stat_file_path}"'),