File size: 537 Bytes
e0a3506
 
 
 
 
2f350d6
13aac28
 
 
 
 
 
 
 
 
e0a3506
ecc051b
e0a3506
 
 
ecc051b
e0a3506
fce8789
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from flask import Flask, render_template, request
from io import BytesIO
from client import client

app = Flask(__name__,)
app.config['MAX_CONTENT_LENGTH'] = 120 * 1024


@app.route('/')
def index():
    return render_template('hello.html')


@app.route('/recognize', methods=["POST"])
def recognize():
    file = request.files['file']
    lang = request.form["lang"]
    audio = BytesIO()
    file.save(audio)
    audio.seek(0)
    result = client(audio, lang)
    return result


if __name__ == '__main__':
    app.run(host='0.0.0.0')