baking_help.py 1.0 KB

123456789101112131415161718192021
  1. from evaluator import *
  2. DESCRIPTION = "Test if the model can identify a missing incredient in a recipe. Identifying incorrect steps is much harder than missing steps."
  3. TAGS = ['explain', 'fun']
  4. question = """
  5. I'm making pancakes for breakfast. I added a cup of flour, a teaspoon of salt, and a few tablespoons of sugar to a bowl. I stirred it together, then added a cup of milk, a beaten egg, and a few tablespoons of oil, and stirred until just mixed. Then I put 1/4 a cup on a hot frying pan, and flipped it when brown. But they're terrible! Why? List the main reason.
  6. """
  7. evaluation = """
  8. Below is a student's answer to a question on what is missing from some pancake recipe: <A>
  9. Does the student mention that baking powder or baking soda is missing? Think out loud, and then end your answer with either the string "The student passes" or "The student fails".
  10. """
  11. TestMissingStep = question >> LLMRun() >> LLMRun(evaluation, llm=EVAL_LLM) >> SubstringEvaluator("student passes")
  12. if __name__ == "__main__":
  13. print(run_test(TestMissingStep))