bluenevus commited on
Commit
fd724e6
·
verified ·
1 Parent(s): 52d788a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -173,9 +173,13 @@ def generate_audio(script_output, voice1, voice2, num_hosts, temperature, top_p,
173
  if len(code_list) < min_length:
174
  code_list = code_list + [0] * (min_length - len(code_list))
175
 
176
- # Use the correct method for audio generation based on your SNAC model
177
- codes_tensor = torch.tensor(code_list).unsqueeze(0).to(device)
178
- paragraph_audio = snac_model(codes_tensor)
 
 
 
 
179
  paragraph_audio = paragraph_audio.cpu().numpy().flatten()
180
 
181
  silences = detect_silence(paragraph_audio)
 
173
  if len(code_list) < min_length:
174
  code_list = code_list + [0] * (min_length - len(code_list))
175
 
176
+ # Convert to float tensor to match bias type
177
+ codes_tensor = torch.tensor(code_list, dtype=torch.float32).unsqueeze(0).to(device)
178
+
179
+ # Generate audio
180
+ with torch.no_grad():
181
+ paragraph_audio = snac_model(codes_tensor)
182
+
183
  paragraph_audio = paragraph_audio.cpu().numpy().flatten()
184
 
185
  silences = detect_silence(paragraph_audio)