thak123 commited on
Commit
13a86d8
1 Parent(s): 68fd044

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
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
- image = image_transformations(image)
153
 
154
- model_input = {
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 ",image)
161
- print(model_input)
162
  prediction = None
163
  with torch.no_grad():
164
- prediction = model(input_ids=[text_inputs.input_id],attention_mask=[text_inputs.attention_mask], pixel_values=[image])
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