Pendrokar commited on
Commit
e494712
β€’
1 Parent(s): 6e5dc62

cached models seem already linked

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -8,9 +8,10 @@ from huggingface_hub import hf_hub_download
8
  import gradio as gr
9
 
10
  hf_model_name = "Pendrokar/xvapitch_nvidia"
11
- hf_cache_models_path = '/tmp/hfcache/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c'
 
 
12
 
13
- models_path = './resources/app/models/ccby/'
14
 
15
  voice_models = [
16
  "ccby_nvidia_hifi_6670_M",
@@ -27,13 +28,13 @@ voice_models = [
27
  current_voice_model = None
28
 
29
  # move models to a more persistant place
30
- try:
31
- for voice_model_name in voice_model_names:
32
- os.rename(hf_cache_models_path +'/'+ voice_model_name + '.pt', models_path + voice_model_name + '.pt')
33
- os.rename(hf_cache_models_path +'/'+ voice_model_name + '.json', models_path + voice_model_name + '.json')
34
- os.rename(hf_cache_models_path +'/'+ voice_model_name + '.wav', models_path + voice_model_name + '.wav')
35
- except Exception as e:
36
- print('Failed to move downloaded models, perhaps already moved')
37
 
38
  def run_xvaserver():
39
  # start the process without waiting for a response
 
8
  import gradio as gr
9
 
10
  hf_model_name = "Pendrokar/xvapitch_nvidia"
11
+ hf_cache_models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
12
+ # models_path = './resources/app/models/ccby/'
13
+ models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
14
 
 
15
 
16
  voice_models = [
17
  "ccby_nvidia_hifi_6670_M",
 
28
  current_voice_model = None
29
 
30
  # move models to a more persistant place
31
+ # try:
32
+ # for voice_model_name in voice_model_names:
33
+ # os.rename(hf_cache_models_path + voice_model_name + '.pt', models_path + voice_model_name + '.pt')
34
+ # os.rename(hf_cache_models_path + voice_model_name + '.json', models_path + voice_model_name + '.json')
35
+ # os.rename(hf_cache_models_path + voice_model_name + '.wav', models_path + voice_model_name + '.wav')
36
+ # except Exception as e:
37
+ # print(f'Failed to move downloaded models, perhaps already moved: {e}')
38
 
39
  def run_xvaserver():
40
  # start the process without waiting for a response