Pendrokar commited on
Commit
f8e12ae
β€’
1 Parent(s): a442c6c

Accept ex02 Expresso model

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -9,6 +9,7 @@ import resources.app.no_server as xvaserver
9
 
10
  from gr_client import BlocksDemo
11
 
 
12
  # NVIDIA NeMo models
13
  hf_model_name = "Pendrokar/xvapitch_nvidia"
14
  model_repo = HfApi()
@@ -17,6 +18,11 @@ latest_commit_sha = commits[0].commit_id
17
  hf_cache_models_path = f'/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/{latest_commit_sha}/'
18
  models_path = hf_cache_models_path
19
 
 
 
 
 
 
20
  # Lojban model
21
  commits = model_repo.list_repo_commits(repo_id='Pendrokar/xvasynth_lojban')
22
  latest_commit_sha = commits[0].commit_id
@@ -45,13 +51,14 @@ def load_model(voice_model_name):
45
  model_path = hf_cache_lojban_models_path + voice_model_name
46
  model_type = 'FastPitch1.1'
47
  else:
 
48
  if voice_model_name == 'cnc_cabal':
49
  model_path = hf_cache_robotic_models_path + voice_model_name
50
- else:
51
- model_path = models_path + voice_model_name
52
  model_type = 'xVAPitch'
53
 
54
- language = 'en' # seems to have no effect if generated text is from a different language
55
 
56
  data = {
57
  'outputs': None,
 
9
 
10
  from gr_client import BlocksDemo
11
 
12
+ # TODO: move snapshots to common folder & use an models array
13
  # NVIDIA NeMo models
14
  hf_model_name = "Pendrokar/xvapitch_nvidia"
15
  model_repo = HfApi()
 
18
  hf_cache_models_path = f'/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/{latest_commit_sha}/'
19
  models_path = hf_cache_models_path
20
 
21
+ # Expresso models
22
+ commits = model_repo.list_repo_commits(repo_id='Pendrokar/xvapitch_expresso')
23
+ latest_commit_sha = commits[0].commit_id
24
+ hf_cache_expresso_models_path = f'/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_expresso/snapshots/{latest_commit_sha}/'
25
+
26
  # Lojban model
27
  commits = model_repo.list_repo_commits(repo_id='Pendrokar/xvasynth_lojban')
28
  latest_commit_sha = commits[0].commit_id
 
51
  model_path = hf_cache_lojban_models_path + voice_model_name
52
  model_type = 'FastPitch1.1'
53
  else:
54
+ model_path = models_path + voice_model_name
55
  if voice_model_name == 'cnc_cabal':
56
  model_path = hf_cache_robotic_models_path + voice_model_name
57
+ if voice_model_name == 'x_ex02':
58
+ model_path = hf_cache_expresso_models_path + voice_model_name
59
  model_type = 'xVAPitch'
60
 
61
+ language = 'en' # seems to have no effect if generated text is for a different language
62
 
63
  data = {
64
  'outputs': None,