Spaces:
Runtime error
Runtime error
lyangas
commited on
Commit
•
4a7adf1
1
Parent(s):
3a4727b
get data from req
Browse files
app.py
CHANGED
@@ -39,13 +39,13 @@ def test_get():
|
|
39 |
|
40 |
@app.route("/test", methods=['POST'])
|
41 |
def test():
|
42 |
-
data = request.
|
43 |
return {'response': data}
|
44 |
|
45 |
@app.route("/predict", methods=['POST'])
|
46 |
def read_root():
|
47 |
-
|
48 |
-
data
|
49 |
text = str(data['text'])
|
50 |
top_n = int(data['top_n'])
|
51 |
|
|
|
39 |
|
40 |
@app.route("/test", methods=['POST'])
|
41 |
def test():
|
42 |
+
data = request.json
|
43 |
return {'response': data}
|
44 |
|
45 |
@app.route("/predict", methods=['POST'])
|
46 |
def read_root():
|
47 |
+
data = request.json
|
48 |
+
print(data)
|
49 |
text = str(data['text'])
|
50 |
top_n = int(data['top_n'])
|
51 |
|