Closed mercuryyy closed 9 months ago
I was able to bypass the bug but now i am not able to figure out how i can include the audio file in the api response.
print("State keys:", state.keys())
print("Is 'character_menu' in state:", "character_menu" in state)
try:
if "character_menu" in state:
character_menu = state["character_menu"]
else:
character_menu = "default_value"
except KeyError as e:
print("KeyError encountered:", e)
output_file = Path(f'extensions/silero_tts/outputs/{character_menu}_{int(time.time())}.wav')
# output_file = Path(f'extensions/silero_tts/outputs/{state["character_menu"]}_{int(time.time())}.wav')
I was able to bypass the error but i want it to send the $output_file url in the api response, should probably be the default behavior
This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.
Describe the bug
When Using Silero_tts there is a conflict when calling the built in api http://127.0.0.1:5000/v1/chat/completions" ...
From what i can make of it, the audio file is inserted into the prompt but it does not get generated in time and cause an error.
Iv been playing with setting and trying to recode script.py for the extension but i can not figure it out.
Is there an existing issue for this?
Reproduction
Enable Silero_tts
And just make a regular api request:
`
import requests
url = "http://127.0.0.1:5000/v1/chat/completions"
headers = { "Content-Type": "application/json" }
history = []
while True: user_message = input("> ") history.append({"role": "user", "content": user_message}) data = { "mode": "chat", "character": "Llama8", "messages": history, "stream": False }
`
Screenshot
No response
Logs
System Info