Sander Land commited on
Commit
1700c40
·
1 Parent(s): a2ab48a
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -35,14 +35,16 @@ st.header("Recipe Generation")
35
  #st.selectbox("Choose a cuisine:", options=['mexican', 'italian'], key="cuisine")
36
 
37
  st.write("What would you like a recipe for?")
 
38
 
39
  with st.form("form"):
 
40
  dish = st.text_input("Dish", placeholder=DEFAULT_DISH)
41
  options = st.multiselect("Special requests", [
42
  "extra delicious", "vegan", "gluten-free", "sugar-free", "dairy-free", "nut-free", "low-calorie", "low-fat",
43
  "low-sugar"
44
  ])
45
- submitted = st.form_submit_button("Generate Recipe!")
46
 
47
  if submitted:
48
  dish = (dish or DEFAULT_DISH).strip()
@@ -55,7 +57,7 @@ if submitted:
55
  gens = command(co, prompt)
56
  recipe = gens[0].text
57
  num_tokens = len(gens[0].token_likelihoods)
58
- logger.info(f"Generated recipe with {num_tokens} tokens in {time.time()-start:.1fs}: {repr(recipe)}")
59
  st.markdown(f"## Recipe for {' '.join(options)} {dish}")
60
  st.write(recipe)
61
  st.markdown("## Delicious! 10/10 with rice")
 
35
  #st.selectbox("Choose a cuisine:", options=['mexican', 'italian'], key="cuisine")
36
 
37
  st.write("What would you like a recipe for?")
38
+ st.session_state.disabled = False
39
 
40
  with st.form("form"):
41
+
42
  dish = st.text_input("Dish", placeholder=DEFAULT_DISH)
43
  options = st.multiselect("Special requests", [
44
  "extra delicious", "vegan", "gluten-free", "sugar-free", "dairy-free", "nut-free", "low-calorie", "low-fat",
45
  "low-sugar"
46
  ])
47
+ submitted = st.form_submit_button(label="Generate Recipe!")
48
 
49
  if submitted:
50
  dish = (dish or DEFAULT_DISH).strip()
 
57
  gens = command(co, prompt)
58
  recipe = gens[0].text
59
  num_tokens = len(gens[0].token_likelihoods)
60
+ logger.info(f"Generated recipe with {num_tokens} tokens in {time.time()-start:.1f}s: {repr(recipe)}")
61
  st.markdown(f"## Recipe for {' '.join(options)} {dish}")
62
  st.write(recipe)
63
  st.markdown("## Delicious! 10/10 with rice")