Jofthomas HF staff commited on
Commit
3f22226
1 Parent(s): e4dd4d6

Update coqui.py

Browse files
Files changed (1) hide show
  1. coqui.py +8 -3
coqui.py CHANGED
@@ -1,11 +1,12 @@
1
  import sys
2
  import io, os, stat
 
 
3
  import subprocess
4
  import random
5
  from zipfile import ZipFile
6
  import uuid
7
  import time
8
- import torch
9
  import torchaudio
10
  import numpy as np
11
 
@@ -78,9 +79,13 @@ if not os.path.exists(checkpoint_path):
78
  if not os.path.exists(vocab_path):
79
  raise FileNotFoundError(f"Vocab file not found at {vocab_path}")
80
 
 
 
 
 
81
  model.load_checkpoint(
82
  config,
83
- checkpoint_path=checkpoint_path,
84
  vocab_path=vocab_path,
85
  eval=True,
86
  use_deepspeed=True,
@@ -410,4 +415,4 @@ def predict(
410
  gr.Warning("Please accept the Terms & Condition!")
411
  return (
412
  None,
413
- )
 
1
  import sys
2
  import io, os, stat
3
+ import torch
4
+
5
  import subprocess
6
  import random
7
  from zipfile import ZipFile
8
  import uuid
9
  import time
 
10
  import torchaudio
11
  import numpy as np
12
 
 
79
  if not os.path.exists(vocab_path):
80
  raise FileNotFoundError(f"Vocab file not found at {vocab_path}")
81
 
82
+ if not os.environ.get('CUDA_HOME'):
83
+ print(f"ENV var CUDA_HOME is not set, defaulting to: '/usr/local/cuda'")
84
+ os.environ['CUDA_HOME'] = f"/usr/local/cuda"
85
+
86
  model.load_checkpoint(
87
  config,
88
+ checkpoint_dir=model_path,
89
  vocab_path=vocab_path,
90
  eval=True,
91
  use_deepspeed=True,
 
415
  gr.Warning("Please accept the Terms & Condition!")
416
  return (
417
  None,
418
+ )