Shoxie commited on
Commit
fd3c366
1 Parent(s): b976814

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -50,10 +50,11 @@ if rus_buton:
50
  else:
51
  ingredients = st.text_area("Write the ingredients of the dish")
52
  recipe = st.text_area("Write the recipe")
53
- servings = int(st.text_area("Write number of servings"))
54
- data = pd.DataFrame({'TranslatedInstructions':[recipe],'TranslatedIngredients':[ingredients],'Servings': [servings]})
55
- result_button = st.button('Click')
56
- if result_button:
57
- time = model.predict(data)[0]
58
- st.write('The dish will be prepared')
59
- st.write(int(time))
 
 
50
  else:
51
  ingredients = st.text_area("Write the ingredients of the dish")
52
  recipe = st.text_area("Write the recipe")
53
+ servings = st.text_area("Write number of servings")
54
+ if len(servings):
55
+ data = pd.DataFrame({'TranslatedInstructions':[recipe],'TranslatedIngredients':[ingredients],'Servings': [int(servings)]})
56
+ result_button = st.button('Click')
57
+ if result_button:
58
+ time = model.predict(data)[0]
59
+ st.write('The dish will be prepared')
60
+ st.write(int(time))