qisan commited on
Commit
4b4aa45
1 Parent(s): 44dda57

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -38,9 +38,10 @@ def analyse(text):
38
  pad_to_max_length=True,
39
  return_attention_mask=True,
40
  return_tensors='pt')
41
- face_url = "https://raw.githubusercontent.com/liangc40/ID2223_Sentimental_Analysis_Project/main/Image/"+ str(preds) + ".png"
42
  outputs = model(input_ids = encoding['input_ids'], attention_mask = encoding['attention_mask'])
43
  _, preds = torch.max(outputs, dim=1)
 
44
  img = Image.open(requests.get(face_url, stream=True).raw)
45
  #print(preds)
46
  return img
 
38
  pad_to_max_length=True,
39
  return_attention_mask=True,
40
  return_tensors='pt')
41
+
42
  outputs = model(input_ids = encoding['input_ids'], attention_mask = encoding['attention_mask'])
43
  _, preds = torch.max(outputs, dim=1)
44
+ face_url = "https://raw.githubusercontent.com/liangc40/ID2223_Sentimental_Analysis_Project/main/Image/"+ str(preds) + ".png"
45
  img = Image.open(requests.get(face_url, stream=True).raw)
46
  #print(preds)
47
  return img