Spaces:
Running
Running
File size: 1,053 Bytes
56266ec 39e27f0 aa87a91 53ac83e 3ff429e 22ad7f3 aa87a91 22ad7f3 53ac83e 22ad7f3 9a5dd56 4de9537 bf59c35 9a5dd56 56266ec 3ff429e 56266ec 2732528 3ff429e 3f656fb 6844ad4 3f656fb 880e759 aa87a91 3ff429e f97ddf1 |
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
from flask import Flask, request
from app import judge, judgePlus, judgeBert
from phoBERT import BERT_predict
from flask_cors import CORS
import threading
import time
app = Flask(__name__)
CORS(app)
@app.route("/")
def hello():
return {"hello":"Deploy success"}
@app.route("/test")
def test():
return "Test success"
@app.route("/test/<text>")
def returnText(text):
return f'The text is {text}'
@app.route("/check", methods=["POST"])
def check():
comment = request.json['comment']
result = judge(comment)
return result
@app.route("/checkplus", methods=["POST"])
def checkPlus():
comment = request.json['comment']
result = judgePlus(comment)
return result
@app.route("/checkbert", methods=["POST"])
def checkBert():
comment = request.json['comment']
result = judgeBert(comment)
return result
@app.route("/check_time")
def time():
l10 = []
l100 = []
l200 = []
return 'ok'
if __name__ == '__main__':
app.run(debug=False, threaded=True) |