Hardcode test.wav path

This commit is contained in:
SillyLossy
2023-07-09 21:46:45 +03:00
parent f00807e2ee
commit 0b25aff3e1

View File

@@ -686,13 +686,13 @@ def tts_generate():
# Remove asterisks
voice["text"] = voice["text"].replace("*", "")
try:
# Remove the destination file if it already exists
if os.path.exists('test.wav'):
os.remove('test.wav')
audio = tts_service.generate(voice["speaker"], voice["text"])
audio_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.basename(audio))
# Remove the destination file if it already exists
if os.path.exists(audio_file_path):
os.remove(audio_file_path)
os.rename(audio, audio_file_path)
return send_file(audio_file_path, mimetype="audio/x-wav")
except Exception as e:
@@ -913,7 +913,7 @@ def chromadb_export():
except Exception as e:
print(e)
abort(400, "Chat collection not found in chromadb")
collection_content = collection.get()
documents = collection_content.get('documents', [])
ids = collection_content.get('ids', [])