loubnabnl HF staff commited on
Commit
b3b0b5a
β€’
1 Parent(s): 835e9c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -140,7 +140,8 @@ if st.button("Test my solution", key=2):
140
  test_cases = [test_func]
141
  candidates = [[candidate_solution]]
142
  pass_at_k, _ = code_eval.compute(references=test_cases, predictions=candidates)
143
- st.markdown(f"Your pass@1 is {int(pass_at_k['pass@1'])}")
 
144
  if st.button("Show model solution", key=3):
145
  st.markdown(solution)
146
 
 
140
  test_cases = [test_func]
141
  candidates = [[candidate_solution]]
142
  pass_at_k, _ = code_eval.compute(references=test_cases, predictions=candidates)
143
+ text = "Your solution didn't pass the test, pass@1 is 0 πŸ˜•" if int(pass_at_k['pass@1']) < 1 else "Congrats your pass@1 is 1! πŸŽ‰"
144
+ st.markdown(text)
145
  if st.button("Show model solution", key=3):
146
  st.markdown(solution)
147