forked from voicy-ai/DialogStateTracking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
40 lines (29 loc) · 663 Bytes
/
app.py
File metadata and controls
40 lines (29 loc) · 663 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
from flask import Flask, render_template, request
from flask import jsonify
import main as botmodule
# global
bot = None
app = Flask(__name__,static_url_path="/static")
'''
Routing
'''
# @GET
# PATH : /query
@app.route('/query', methods=['GET'])
def reply():
return bot.reply(request.args['msg'])
'''
return jsonify( {
'ans' : 'dummy text'
})
'''
# render page "index.html"
# PATH : /
@app.route("/")
def index():
return render_template("index.html")
if (__name__ == "__main__"):
# before starting the app, init model
bot = botmodule.main(['--ui', '--task_id=1'])
# start app
app.run(port = 5000)