XzJosh commited on
Commit
514e8f4
1 Parent(s): b36dfde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -30,7 +30,12 @@ from time import time as ttime
30
  from module.mel_processing import spectrogram_torch
31
  from my_utils import load_audio
32
 
33
- device = "cpu"
 
 
 
 
 
34
  tokenizer = AutoTokenizer.from_pretrained(bert_path)
35
  bert_model = AutoModelForMaskedLM.from_pretrained(bert_path)
36
  if is_half == True:
 
30
  from module.mel_processing import spectrogram_torch
31
  from my_utils import load_audio
32
 
33
+ device = "cuda" if torch.cuda.is_available() else "cpu"
34
+
35
+ is_half = eval(
36
+ os.environ.get("is_half", "True" if torch.cuda.is_available() else "False")
37
+ )
38
+
39
  tokenizer = AutoTokenizer.from_pretrained(bert_path)
40
  bert_model = AutoModelForMaskedLM.from_pretrained(bert_path)
41
  if is_half == True: