u
This commit is contained in:
@@ -45,5 +45,5 @@ RUN mkdir -p uploads
|
|||||||
ENV WHISPER_CPP_PATH="/app/whisper.cpp"
|
ENV WHISPER_CPP_PATH="/app/whisper.cpp"
|
||||||
ENV MODEL_PATH="/app/whisper.cpp/models/ggml-small.en.bin"
|
ENV MODEL_PATH="/app/whisper.cpp/models/ggml-small.en.bin"
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 4002
|
||||||
CMD ["python3", "app.py"]
|
CMD ["python3", "app.py"]
|
||||||
|
|||||||
4
app.py
4
app.py
@@ -8,7 +8,7 @@ app = Flask(__name__)
|
|||||||
WHISPER_CPP_PATH = os.getenv("WHISPER_CPP_PATH", "/app/whisper.cpp/main") # Absolute path
|
WHISPER_CPP_PATH = os.getenv("WHISPER_CPP_PATH", "/app/whisper.cpp/main") # Absolute path
|
||||||
MODEL_PATH = os.getenv("MODEL_PATH", "/app/whisper.cpp/models/ggml-small.en.bin") # Absolute path
|
MODEL_PATH = os.getenv("MODEL_PATH", "/app/whisper.cpp/models/ggml-small.en.bin") # Absolute path
|
||||||
|
|
||||||
@app.route('/transcribe', methods=['POST'])
|
@app.route('/stt', methods=['POST'])
|
||||||
def transcribe_audio():
|
def transcribe_audio():
|
||||||
if 'audio' not in request.files:
|
if 'audio' not in request.files:
|
||||||
return jsonify({"error": "No audio file provided"}), 400
|
return jsonify({"error": "No audio file provided"}), 400
|
||||||
@@ -56,4 +56,4 @@ def transcribe_audio():
|
|||||||
os.remove(tmp_path + ".txt")
|
os.remove(tmp_path + ".txt")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', port=5000)
|
app.run(host='0.0.0.0', port=4002)
|
||||||
|
|||||||
Reference in New Issue
Block a user