Kar 2025-06-15 22:09:40 +05:30
parent b2321fc156
commit 561333d2cd
2 changed files with 3 additions and 3 deletions

View File

@ -45,5 +45,5 @@ RUN mkdir -p uploads
ENV WHISPER_CPP_PATH="/app/whisper.cpp"
ENV MODEL_PATH="/app/whisper.cpp/models/ggml-small.en.bin"
EXPOSE 5000
EXPOSE 4002
CMD ["python3", "app.py"]

4
app.py
View File

@ -8,7 +8,7 @@ app = Flask(__name__)
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
@app.route('/transcribe', methods=['POST'])
@app.route('/stt', methods=['POST'])
def transcribe_audio():
if 'audio' not in request.files:
return jsonify({"error": "No audio file provided"}), 400
@ -56,4 +56,4 @@ def transcribe_audio():
os.remove(tmp_path + ".txt")
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
app.run(host='0.0.0.0', port=4002)