jonathantiedchen commited on
Commit
4cc9747
Β·
verified Β·
1 Parent(s): c66f94f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -95,6 +95,7 @@ if st.button("🎲 Pick Random Question"):
95
 
96
  default_prompt = "Jasper has 5 apples and eats 2 of them. How many apples does he have left?"
97
  selected_question = gsm8k_data[question_index]["question"] if question_index is not None else default_prompt
 
98
 
99
 
100
  # Prompt options
@@ -137,7 +138,10 @@ if st.button("Generate Response", key="manual"):
137
  generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
138
  response_only = generated_text[len(input_text):].strip() if generated_text.startswith(input_text) else generated_text.strip()
139
 
140
- st.subheader("πŸ”Ž Prompt")
141
- st.write(input_text)
 
142
  st.subheader("🧠 Model Output")
143
  st.success(response_only)
 
 
 
95
 
96
  default_prompt = "Jasper has 5 apples and eats 2 of them. How many apples does he have left?"
97
  selected_question = gsm8k_data[question_index]["question"] if question_index is not None else default_prompt
98
+ correct_answer = gsm8k_data[question_index]["answer"]
99
 
100
 
101
  # Prompt options
 
138
  generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
139
  response_only = generated_text[len(input_text):].strip() if generated_text.startswith(input_text) else generated_text.strip()
140
 
141
+ with st.expander("πŸ”Ž Prompt"):
142
+ st.subheader("πŸ”Ž Prompt")
143
+ st.write(input_text)
144
  st.subheader("🧠 Model Output")
145
  st.success(response_only)
146
+ st.subheader("βœ… Correct Answer (GSM8K)")
147
+ st.info(correct_answer)