m3hrdadfi commited on
Commit
6732512
1 Parent(s): b329690
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -241,10 +241,11 @@ def main():
241
  if st.button('Get Recipe!'):
242
  entered_items.markdown("**Generate recipe for:** " + items)
243
  with st.spinner("Generating recipe..."):
244
- gen_kw = chef_top if chef == "Chef Scheherazade" else chef_beam
245
- generated_recipe = generator.generate(items, gen_kw)
246
 
247
- if generated_recipe:
 
 
 
248
  if is_text:
249
  title = generated_recipe["title"]
250
  ingredients = generated_recipe["ingredients"]
@@ -283,6 +284,8 @@ def main():
283
 
284
  with col3:
285
  st.write("")
 
 
286
 
287
 
288
  if __name__ == '__main__':
241
  if st.button('Get Recipe!'):
242
  entered_items.markdown("**Generate recipe for:** " + items)
243
  with st.spinner("Generating recipe..."):
 
 
244
 
245
+ if isinstance(items, str) and len(items) > 1:
246
+ gen_kw = chef_top if chef == "Chef Scheherazade" else chef_beam
247
+ generated_recipe = generator.generate(items, gen_kw)
248
+
249
  if is_text:
250
  title = generated_recipe["title"]
251
  ingredients = generated_recipe["ingredients"]
284
 
285
  with col3:
286
  st.write("")
287
+ else:
288
+ entered_items.markdown("Enter your items...")
289
 
290
 
291
  if __name__ == '__main__':