Spaces:
Runtime error
Runtime error
SameAttribute fix
Browse files- app.py +1 -0
- templates/index.html +5 -1
app.py
CHANGED
|
@@ -26,6 +26,7 @@ def recommend():
|
|
| 26 |
try:
|
| 27 |
short_output_summary, long_output_summary = summarize(input_text)
|
| 28 |
response = jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
|
|
|
|
| 29 |
# Pass output summary to the output template
|
| 30 |
return response
|
| 31 |
|
|
|
|
| 26 |
try:
|
| 27 |
short_output_summary, long_output_summary = summarize(input_text)
|
| 28 |
response = jsonify({'short': short_output_summary.strip(), 'long': long_output_summary.strip()})
|
| 29 |
+
response.headers.add('Set-Cookie','cookie2=value2; SameSite=None; Secure')
|
| 30 |
# Pass output summary to the output template
|
| 31 |
return response
|
| 32 |
|
templates/index.html
CHANGED
|
@@ -188,7 +188,11 @@
|
|
| 188 |
// ======= COMMUNICATE WITH FLSAK BACK END TO RUN ML TASK =======
|
| 189 |
|
| 190 |
const translateText = async (jsonfile) => {
|
| 191 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
const inferJson = await inferResponse.json();
|
| 193 |
|
| 194 |
return inferJson;
|
|
|
|
| 188 |
// ======= COMMUNICATE WITH FLSAK BACK END TO RUN ML TASK =======
|
| 189 |
|
| 190 |
const translateText = async (jsonfile) => {
|
| 191 |
+
const fetchSettings = {
|
| 192 |
+
method: 'POST',
|
| 193 |
+
mode: 'no-cors',
|
| 194 |
+
};
|
| 195 |
+
const inferResponse = await fetch(`/summarize?input=${jsonfile}`, fetchSettings);
|
| 196 |
const inferJson = await inferResponse.json();
|
| 197 |
|
| 198 |
return inferJson;
|