Spaces:
Runtime error
Runtime error
Add CORS to request's header
Browse files
app.py
CHANGED
@@ -24,8 +24,10 @@ def recommend():
|
|
24 |
# Call the function summarize to run the text summarization
|
25 |
try:
|
26 |
short_output_summary, long_output_summary = summarize(input_text)
|
|
|
|
|
27 |
# Pass output summary to the output template
|
28 |
-
return
|
29 |
|
30 |
except Exception as e:
|
31 |
return render_template('index.html', query=e)
|
|
|
24 |
# Call the function summarize to run the text summarization
|
25 |
try:
|
26 |
short_output_summary, long_output_summary = summarize(input_text)
|
27 |
+
response = jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
|
28 |
+
response.headers.add('Access-Control-Allow-Origin', '*')
|
29 |
# Pass output summary to the output template
|
30 |
+
return response
|
31 |
|
32 |
except Exception as e:
|
33 |
return render_template('index.html', query=e)
|