ryantong3 commited on
Commit
5cab462
·
verified ·
1 Parent(s): 92db232

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -7,7 +7,7 @@ import streamlit as st
7
  def predict(image):
8
  type_food = oracle(image, "What type of food is this?")
9
  cal_est = oracle(image, "About how many calories are in this meal?")
10
- guess1, guess2 = cal_est[0]['answer'], cal_est[1]['answer']
11
  return f"This is {type_food[0]['answer']}. I estimate this to contain {min(guess1, guess2)}-{max(guess1, guess2)} calories"
12
  oracle = pipeline(model="dandelin/vilt-b32-finetuned-vqa")
13
 
 
7
  def predict(image):
8
  type_food = oracle(image, "What type of food is this?")
9
  cal_est = oracle(image, "About how many calories are in this meal?")
10
+ guess1, guess2 = int(cal_est[0]['answer']), int(cal_est[1]['answer'])
11
  return f"This is {type_food[0]['answer']}. I estimate this to contain {min(guess1, guess2)}-{max(guess1, guess2)} calories"
12
  oracle = pipeline(model="dandelin/vilt-b32-finetuned-vqa")
13