altndrr commited on
Commit
f6c2567
1 Parent(s): 50c0cb3

Update model output processing

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -47,7 +47,7 @@ def vic(filename: str, alpha: Optional[float] = None):
47
  images = processor(images=[Image.open(filename)], return_tensors="pt", padding=True)
48
  outputs = model(images, alpha=alpha)
49
  vocabulary = outputs["vocabularies"][0]
50
- scores = outputs["scores"][0]
51
  confidences = dict(zip(vocabulary, scores))
52
 
53
  return confidences
 
47
  images = processor(images=[Image.open(filename)], return_tensors="pt", padding=True)
48
  outputs = model(images, alpha=alpha)
49
  vocabulary = outputs["vocabularies"][0]
50
+ scores = outputs["scores"][0].tolist()
51
  confidences = dict(zip(vocabulary, scores))
52
 
53
  return confidences