sanikamal commited on
Commit
b3847c9
1 Parent(s): 308da85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -14,8 +14,8 @@ def get_format_response(image,question,selected_model):
14
  processor = processor.from_pretrained(model_name)
15
  model = model_class.from_pretrained(model_name)
16
  encoding = processor(image, question, return_tensors="pt")
17
- outputs = model(**encoding)
18
  if selected_model=='ViLT':
 
19
  logits = outputs.logits
20
  idx = logits.argmax(-1).item()
21
  answer = model.config.id2label[idx]
 
14
  processor = processor.from_pretrained(model_name)
15
  model = model_class.from_pretrained(model_name)
16
  encoding = processor(image, question, return_tensors="pt")
 
17
  if selected_model=='ViLT':
18
+ outputs = model(**encoding)
19
  logits = outputs.logits
20
  idx = logits.argmax(-1).item()
21
  answer = model.config.id2label[idx]