PatrickML commited on
Commit
f8236f9
1 Parent(s): 05504f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -30,10 +30,11 @@ def predict_sentiment(text):
30
  input = vectoriser.transform(input)
31
  res = model.predict(input)
32
  if (res==1):
33
- sentiment="https://files.selecthealth.cloud/api/public/content/228422-being_positive_blog_lg.jpg"
34
  else :
35
- sentiment="https://mentalhealthatease.com/wp-content/uploads/2022/02/girl-with-negative-thoughts-scaled.jpeg"
36
- return sentiment
 
37
 
38
 
39
  iface = gr.Interface(
 
30
  input = vectoriser.transform(input)
31
  res = model.predict(input)
32
  if (res==1):
33
+ sentiment_url="https://files.selecthealth.cloud/api/public/content/228422-being_positive_blog_lg.jpg"
34
  else :
35
+ sentiment_url="https://mentalhealthatease.com/wp-content/uploads/2022/02/girl-with-negative-thoughts-scaled.jpeg"
36
+ img = Image.open(requests.get(sentiment_url, stream=True).raw)
37
+ return img
38
 
39
 
40
  iface = gr.Interface(