uyen13 commited on
Commit
7ea215d
·
1 Parent(s): 9f80335

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -6,18 +6,11 @@ load_dotenv()
6
 
7
  app = Flask(__name__)
8
 
9
- @app.route("/", methods=["GET"])
10
  def index():
11
- return """<h1>Flask Server Running</h1>
12
- <p>
13
- Send a JSON POST request in the format
14
- {
15
- "sentence": "...",
16
- "labels": ["...", "...", "..."]
17
- "multi_label": 0 / 1
18
- }
19
- to get predictions
20
- </p>"""
21
 
22
  if __name__ == "__main__":
23
  app.run(host="0.0.0.0",port="7860")
 
6
 
7
  app = Flask(__name__)
8
 
9
+ @app.route("/", methods=["POST"])
10
  def index():
11
+ data = json.loads(request.data.decode())
12
+ response = jsonify(data["test1"]+data["test2"])
13
+ return response
 
 
 
 
 
 
 
14
 
15
  if __name__ == "__main__":
16
  app.run(host="0.0.0.0",port="7860")