Jofthomas HF staff commited on
Commit
dfc063a
·
verified ·
1 Parent(s): a6818a7

Update TextGen/router.py

Browse files
Files changed (1) hide show
  1. TextGen/router.py +10 -11
TextGen/router.py CHANGED
@@ -51,8 +51,7 @@ song_base_api=os.environ["VERCEL_API"]
51
 
52
  my_hf_token=os.environ["HF_TOKEN"]
53
 
54
- tts_client = Client("https://jofthomas-xtts.hf.space/",hf_token=my_hf_token)
55
-
56
 
57
  main_npcs={
58
  "Blacksmith":"./voices/Blacksmith.mp3",
@@ -134,15 +133,15 @@ async def generate_wav(message:VoiceMessage):
134
  voice=determine_vocie_from_npc(message.npc, message.genre)
135
  # Use the Gradio client to generate the wav file
136
  result = tts_client.predict(
137
- message.input, # str in 'Text Prompt' Textbox component
138
- message.language, # str in 'Language' Dropdown component
139
- voice, # str (filepath on your computer (or URL) of file) in 'Reference Audio' Audio component
140
- voice, # str (filepath on your computer (or URL) of file) in 'Use Microphone for Reference' Audio component
141
- False, # bool in 'Use Microphone' Checkbox component
142
- False, # bool in 'Cleanup Reference Voice' Checkbox component
143
- False, # bool in 'Do not use language auto-detect' Checkbox component
144
- True, # bool in 'Agree' Checkbox component
145
- fn_index=1
146
  )
147
 
148
  # Get the path of the generated wav file
 
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