Spaces:
Runtime error
Runtime error
Update app.py
#12
by
liangc40
- opened
app.py
CHANGED
@@ -42,7 +42,7 @@ def analyse(text):
|
|
42 |
|
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)
|
|
|
42 |
|
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.cpu().detach().numpy()[0]) + ".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)
|