Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# app.py
|
| 2 |
from config import Flask, pipeline_dict, Response, convHandler, get_user_id
|
| 3 |
from application.chat_inference import ChatInference
|
| 4 |
from flask import render_template, request, make_response
|
|
@@ -57,8 +57,9 @@ def tts():
|
|
| 57 |
text = request.args.get('text')
|
| 58 |
if not text:
|
| 59 |
return "No text provided", 400
|
| 60 |
-
audio_stream = generate_tts(text)
|
| 61 |
return Response(audio_stream, mimetype="audio/wav")
|
| 62 |
|
|
|
|
| 63 |
if __name__ == "__main__":
|
| 64 |
app.run(host="0.0.0.0", port=7860, debug=False)
|
|
|
|
| 1 |
+
# app.py (Slight modification)
|
| 2 |
from config import Flask, pipeline_dict, Response, convHandler, get_user_id
|
| 3 |
from application.chat_inference import ChatInference
|
| 4 |
from flask import render_template, request, make_response
|
|
|
|
| 57 |
text = request.args.get('text')
|
| 58 |
if not text:
|
| 59 |
return "No text provided", 400
|
| 60 |
+
audio_stream = generate_tts(text) # Await the result
|
| 61 |
return Response(audio_stream, mimetype="audio/wav")
|
| 62 |
|
| 63 |
+
|
| 64 |
if __name__ == "__main__":
|
| 65 |
app.run(host="0.0.0.0", port=7860, debug=False)
|