Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -149,19 +149,15 @@ def predict_sentiment(text, image):
|
|
149 |
image_processor.image_std,
|
150 |
)
|
151 |
image_transformations = torch.jit.script(image_transformations)
|
152 |
-
|
153 |
|
154 |
-
|
155 |
-
"input_ids" : text_inputs.input_ids,
|
156 |
-
"pixel_values":image,
|
157 |
-
"attention_mask" : text_inputs.attention_mask,
|
158 |
-
}
|
159 |
print(text_inputs)
|
160 |
-
print("its going in ",
|
161 |
-
|
162 |
prediction = None
|
163 |
with torch.no_grad():
|
164 |
-
prediction = model(input_ids=
|
165 |
print(prediction)
|
166 |
return prediction
|
167 |
|
|
|
149 |
image_processor.image_std,
|
150 |
)
|
151 |
image_transformations = torch.jit.script(image_transformations)
|
152 |
+
pixel_values = image_transformations(image)
|
153 |
|
154 |
+
|
|
|
|
|
|
|
|
|
155 |
print(text_inputs)
|
156 |
+
print("its going in ",pixel_values)
|
157 |
+
|
158 |
prediction = None
|
159 |
with torch.no_grad():
|
160 |
+
prediction = model(input_ids=text_inputs.input_id,attention_mask=text_inputs.attention_mask, pixel_values=pixel_values)
|
161 |
print(prediction)
|
162 |
return prediction
|
163 |
|