danneauxs commited on
Commit
aaa834b
·
1 Parent(s): ecb40a1

Add CPU fallback for device detection on HF Spaces

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,8 @@ import spaces
8
  from chatterbox.tts_turbo import ChatterboxTurboTTS
9
 
10
 
11
- MODEL = ChatterboxTurboTTS.from_pretrained("cuda" )
 
12
 
13
  EVENT_TAGS = [
14
  "[clear throat]", "[sigh]", "[shush]", "[cough]", "[groan]",
 
8
  from chatterbox.tts_turbo import ChatterboxTurboTTS
9
 
10
 
11
+ device = "cuda" if torch.cuda.is_available() else "cpu"
12
+ MODEL = ChatterboxTurboTTS.from_pretrained(device)
13
 
14
  EVENT_TAGS = [
15
  "[clear throat]", "[sigh]", "[shush]", "[cough]", "[groan]",