cocktailpeanut commited on
Commit
b01a4fc
1 Parent(s): f570b9b
Files changed (1) hide show
  1. melo/download_utils.py +3 -5
melo/download_utils.py CHANGED
@@ -1,7 +1,7 @@
1
  import torch
2
  import os
3
  from . import utils
4
- current_dir = os.getcwd()
5
 
6
  DOWNLOAD_CKPT_URLS = {
7
  'EN': 'https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/basespeakers/EN/checkpoint.pth',
@@ -28,8 +28,7 @@ def load_or_download_config(locale):
28
  assert language in DOWNLOAD_CONFIG_URLS
29
 
30
  #config_path = os.path.expanduser(f'~/.local/share/openvoice/basespeakers/{language}/config.json')
31
- _config_path = os.path.join(current_dir, f"openvoice/basespeakers/{language}/config.json")
32
- config_path = os.path.expanduser(_config_path)
33
  try:
34
  return utils.get_hparams_from_file(config_path)
35
  except:
@@ -43,8 +42,7 @@ def load_or_download_model(locale, device):
43
  language = locale.split('-')[0].upper()
44
  assert language in DOWNLOAD_CKPT_URLS
45
  #ckpt_path = os.path.expanduser(f'~/.local/share/openvoice/basespeakers/{language}/checkpoint.pth')
46
- _ckpt_path = os.path.join(current_dir, f"openvoice/basespeakers/{language}/checkpoint.pth")
47
- ckpt_path = os.path.expanduser(_ckpt_path)
48
  try:
49
  return torch.load(ckpt_path, map_location=device)
50
  except:
 
1
  import torch
2
  import os
3
  from . import utils
4
+ cwd = os.getcwd()
5
 
6
  DOWNLOAD_CKPT_URLS = {
7
  'EN': 'https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/basespeakers/EN/checkpoint.pth',
 
28
  assert language in DOWNLOAD_CONFIG_URLS
29
 
30
  #config_path = os.path.expanduser(f'~/.local/share/openvoice/basespeakers/{language}/config.json')
31
+ config_path = os.path.join(current_dir, f"openvoice/basespeakers/{language}/config.json")
 
32
  try:
33
  return utils.get_hparams_from_file(config_path)
34
  except:
 
42
  language = locale.split('-')[0].upper()
43
  assert language in DOWNLOAD_CKPT_URLS
44
  #ckpt_path = os.path.expanduser(f'~/.local/share/openvoice/basespeakers/{language}/checkpoint.pth')
45
+ ckpt_path = os.path.join(cwd, f"openvoice/basespeakers/{language}/checkpoint.pth")
 
46
  try:
47
  return torch.load(ckpt_path, map_location=device)
48
  except: