datien228 commited on
Commit
f66d9d3
·
1 Parent(s): cda7451

Add CORS to request's header

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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 jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
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)