liangc40 commited on
Commit
1f68a5a
1 Parent(s): 7c862c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -43,9 +43,9 @@ def analyse(text):
43
  outputs = model(input_ids = encoding['input_ids'], attention_mask = encoding['attention_mask'])
44
  _, preds = torch.max(outputs, dim=1)
45
  face_url = "https://raw.githubusercontent.com/liangc40/ID2223_Sentimental_Analysis_Project/main/Image/"+ str(preds) + ".png"
46
- r = requests.get(face_url, stream=True)
47
- img = Image.open(io.BytesIO(r.content))
48
- #img = Image.open(requests.get(face_url, stream=True).raw)
49
  #print(preds)
50
  return img
51
 
 
43
  outputs = model(input_ids = encoding['input_ids'], attention_mask = encoding['attention_mask'])
44
  _, preds = torch.max(outputs, dim=1)
45
  face_url = "https://raw.githubusercontent.com/liangc40/ID2223_Sentimental_Analysis_Project/main/Image/"+ str(preds) + ".png"
46
+ # r = requests.get(face_url, stream=True)
47
+ # img = Image.open(io.BytesIO(r.content))
48
+ img = Image.open(requests.get(face_url, stream=True).raw)
49
  #print(preds)
50
  return img
51