Hilley commited on
Commit
29d509b
1 Parent(s): f04ada1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -69,7 +69,7 @@ def chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input,
69
 
70
  # OpenVoice Clone
71
  ckpt_converter = 'OpenVoice/checkpoints/converter'
72
- device = 'cuda:0'
73
 
74
  tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
75
  tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')
 
69
 
70
  # OpenVoice Clone
71
  ckpt_converter = 'OpenVoice/checkpoints/converter'
72
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
73
 
74
  tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
75
  tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')