HawkeyeHS commited on
Commit
de568f3
·
1 Parent(s): 5a6e780

Add application file

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -48,10 +48,7 @@ def predict():
48
  predicted_class_idx = logits.argmax(-1).item()
49
  print(model.config.id2label[predicted_class_idx])
50
  # Return the predictions
51
- response=json.dumps({"class": model.config.id2label[predicted_class_idx]})
52
- response = Response(response)
53
- response.headers['Content-Security-Policy'] = "script-src 'self' render.com;" # Modify this CSP as needed
54
- return response
55
  except:
56
  return json.dumps({"Uh oh": "We are down"})
57
 
 
48
  predicted_class_idx = logits.argmax(-1).item()
49
  print(model.config.id2label[predicted_class_idx])
50
  # Return the predictions
51
+ return json.dumps({"class": model.config.id2label[predicted_class_idx]})
 
 
 
52
  except:
53
  return json.dumps({"Uh oh": "We are down"})
54