Spaces:
Paused
Paused
Commit
·
e0ffe9c
1
Parent(s):
ffad1c2
Updates Dockerfile
Browse files
app.py
CHANGED
|
@@ -16,9 +16,10 @@ app = Flask(__name__, static_folder="static", static_url_path="")
|
|
| 16 |
CORS(app)
|
| 17 |
|
| 18 |
# Paths
|
| 19 |
-
AUDIO_FOLDER =
|
| 20 |
os.makedirs(AUDIO_FOLDER, exist_ok=True)
|
| 21 |
|
|
|
|
| 22 |
class ChatBot:
|
| 23 |
def __init__(self):
|
| 24 |
self.chat_history_ids = None
|
|
@@ -142,6 +143,6 @@ def chat_endpoint():
|
|
| 142 |
url = f"audio/{wav_name}"
|
| 143 |
return jsonify({"response": resp_text, "audiofile": url})
|
| 144 |
|
| 145 |
-
@app.route(
|
| 146 |
def serve_audio(filename):
|
| 147 |
return send_from_directory(AUDIO_FOLDER, filename)
|
|
|
|
| 16 |
CORS(app)
|
| 17 |
|
| 18 |
# Paths
|
| 19 |
+
AUDIO_FOLDER = os.path.join(dir_path, "static", "audio")
|
| 20 |
os.makedirs(AUDIO_FOLDER, exist_ok=True)
|
| 21 |
|
| 22 |
+
|
| 23 |
class ChatBot:
|
| 24 |
def __init__(self):
|
| 25 |
self.chat_history_ids = None
|
|
|
|
| 143 |
url = f"audio/{wav_name}"
|
| 144 |
return jsonify({"response": resp_text, "audiofile": url})
|
| 145 |
|
| 146 |
+
@app.route("/static/audio/<path:filename>")
|
| 147 |
def serve_audio(filename):
|
| 148 |
return send_from_directory(AUDIO_FOLDER, filename)
|