Jofthomas HF staff commited on
Commit
695a847
1 Parent(s): 697271e

Update TextGen/router.py

Browse files
Files changed (1) hide show
  1. TextGen/router.py +11 -6
TextGen/router.py CHANGED
@@ -51,7 +51,7 @@ song_base_api=os.environ["VERCEL_API"]
51
 
52
  my_hf_token=os.environ["HF_TOKEN"]
53
 
54
- tts_client = Client("Jofthomas/voice-clone",hf_token=my_hf_token)
55
 
56
  main_npcs={
57
  "Blacksmith":"./voices/Blacksmith.mp3",
@@ -133,11 +133,16 @@ async def generate_wav(message:VoiceMessage):
133
  voice=determine_vocie_from_npc(message.npc, message.genre)
134
  # Use the Gradio client to generate the wav file
135
  result = tts_client.predict(
136
- text=message.input,
137
- audio=handle_file(voice),
138
- api_name="/predict"
139
- )
140
- print(result)
 
 
 
 
 
141
 
142
  # Get the path of the generated wav file
143
  wav_file_path = result
 
51
 
52
  my_hf_token=os.environ["HF_TOKEN"]
53
 
54
+ tts_client = Client("Jofthomas/xtts",hf_token=my_hf_token)
55
 
56
  main_npcs={
57
  "Blacksmith":"./voices/Blacksmith.mp3",
 
133
  voice=determine_vocie_from_npc(message.npc, message.genre)
134
  # Use the Gradio client to generate the wav file
135
  result = tts_client.predict(
136
+ prompt=message.input,
137
+ language=message.language,
138
+ audio_file_pth=handle_file(voice),
139
+ mic_file_path=None,
140
+ use_mic=False,
141
+ voice_cleanup=False,
142
+ no_lang_auto_detect=False,
143
+ agree=True,
144
+ api_name="/predict"
145
+ )
146
 
147
  # Get the path of the generated wav file
148
  wav_file_path = result