ollieollie commited on
Commit
f604cb8
·
verified ·
1 Parent(s): a3a6bc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import spaces
7
  from chatterbox.tts_turbo import ChatterboxTurboTTS
8
 
9
  # Check for GPU, but ZeroGPU handles the actual assignment dynamically
10
- DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
11
 
12
  EVENT_TAGS = [
13
  "[clear throat]", "[sigh]", "[shush]", "[cough]", "[groan]",
@@ -97,8 +97,10 @@ def generate(
97
  ):
98
  # Reload model inside the GPU context if it was lost (ZeroGPU quirk)
99
  if model is None:
100
- model = ChatterboxTurboTTS.from_pretrained(DEVICE)
101
 
 
 
102
  if seed_num != 0:
103
  set_seed(int(seed_num))
104
 
 
7
  from chatterbox.tts_turbo import ChatterboxTurboTTS
8
 
9
  # Check for GPU, but ZeroGPU handles the actual assignment dynamically
10
+ DEVICE = "cpu"
11
 
12
  EVENT_TAGS = [
13
  "[clear throat]", "[sigh]", "[shush]", "[cough]", "[groan]",
 
97
  ):
98
  # Reload model inside the GPU context if it was lost (ZeroGPU quirk)
99
  if model is None:
100
+ model = ChatterboxTurboTTS.from_pretrained("cpu")
101
 
102
+ model.to("cuda")
103
+
104
  if seed_num != 0:
105
  set_seed(int(seed_num))
106