Pijush2023 commited on
Commit
4eff8f4
·
verified ·
1 Parent(s): c0af50a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -680,6 +680,7 @@ import ChatTTS
680
  import random
681
  import numpy as np
682
 
 
683
  print("loading ChatTTS model...")
684
  chat = ChatTTS.Chat()
685
  chat.load_models()
@@ -1242,6 +1243,11 @@ def generate_audio_mars5(text):
1242
  chat = ChatTTS.Chat()
1243
  chat.load_models()
1244
 
 
 
 
 
 
1245
  def generate_audio_chattts(text, temperature=0.3, top_p=0.7, top_k=20):
1246
  rand_spk = torch.randn(768)
1247
  params_infer_code = {
 
680
  import random
681
  import numpy as np
682
 
683
+
684
  print("loading ChatTTS model...")
685
  chat = ChatTTS.Chat()
686
  chat.load_models()
 
1243
  chat = ChatTTS.Chat()
1244
  chat.load_models()
1245
 
1246
+ # Ensure the sample rate attribute is set
1247
+ if not hasattr(chat, 'sr'):
1248
+ chat.sr = 22050 # Or the appropriate sample rate for your use case
1249
+
1250
+ # Continue with the rest of your script
1251
  def generate_audio_chattts(text, temperature=0.3, top_p=0.7, top_k=20):
1252
  rand_spk = torch.randn(768)
1253
  params_infer_code = {