Update TextGen/router.py
Browse files- TextGen/router.py +4 -9
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/
|
55 |
|
56 |
main_npcs={
|
57 |
"Blacksmith":"./voices/Blacksmith.mp3",
|
@@ -133,16 +133,11 @@ 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 |
-
|
137 |
-
|
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[1]
|
|
|
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 |
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 |
+
|
141 |
|
142 |
# Get the path of the generated wav file
|
143 |
wav_file_path = result[1]
|