Spaces:
Runtime error
Runtime error
- app.py +1 -2
- templates/index.html +7 -11
app.py
CHANGED
@@ -20,8 +20,7 @@ def recommend():
|
|
20 |
# Get form data
|
21 |
# request_data = request.args.get("input").get_json()
|
22 |
# input_text = request_data['input_text']
|
23 |
-
|
24 |
-
input_text = request_data['input_text']
|
25 |
print(input_text)
|
26 |
|
27 |
# Call the function summarize to run the text summarization
|
|
|
20 |
# Get form data
|
21 |
# request_data = request.args.get("input").get_json()
|
22 |
# input_text = request_data['input_text']
|
23 |
+
input_text = request.get_json()['input_text']
|
|
|
24 |
print(input_text)
|
25 |
|
26 |
# Call the function summarize to run the text summarization
|
templates/index.html
CHANGED
@@ -188,17 +188,13 @@
|
|
188 |
// ======= COMMUNICATE WITH FLSAK BACK END TO RUN ML TASK =======
|
189 |
|
190 |
const translateText = async (jsonfile) => {
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
// },
|
199 |
-
// referrerPolicy: 'no-referrer'
|
200 |
-
// };
|
201 |
-
const inferResponse = await fetch(`summarize?input=${JSON.stringify({"input_text": jsonfile})}`);
|
202 |
const inferJson = await inferResponse.json();
|
203 |
|
204 |
return inferJson;
|
|
|
188 |
// ======= COMMUNICATE WITH FLSAK BACK END TO RUN ML TASK =======
|
189 |
|
190 |
const translateText = async (jsonfile) => {
|
191 |
+
const fetchSettings = {
|
192 |
+
body: JSON.stringify({"input_text": jsonfile}),
|
193 |
+
headers: {
|
194 |
+
"Content-Type": "application/json"
|
195 |
+
},
|
196 |
+
};
|
197 |
+
const inferResponse = await fetch(`summarize`, fetchSettings);
|
|
|
|
|
|
|
|
|
198 |
const inferJson = await inferResponse.json();
|
199 |
|
200 |
return inferJson;
|