Error messages

While doing Module-2, on the test I got the message NameError: name ‘test_your_code’ is not defined when asked to test the code and ImportError: cannot import name ‘print_llm_response’ from ‘helper_functions’ (/home/jovyan/work/helper_functions.py) in relation to putting ‘from helper_functions import print_llm_response,get_llm_response’ at the top in the final exercise. The Coursera coach was unable to give me any instructions that I could follow on either of these, but partly because these issues I was unable to pass the test for the module. Please can someone advise in detail on what I should do to rectify these problems.

  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook)

Two tips:

  • Use the Coursera platform - don’t try to run the notebooks locally.
  • Don’t add any extra ‘import’ statements. They are not necessary.
  • (Bonus) Every time you open a notebook, you must run all of the cells starting from the top.

To add on what Tom mentioned in his second bullet: Don’t import/use “print_llm_response” or “get_llm_response” in places where it has not already been given to you. When you are required to use those, these functions are already provided to you in the code snippets.

It does not work for me. It says these functions are not defined.

Please post a screen capture image that shows the error messages.

Hi @nespechalt,

Just today, the markdown has been significantly revised for the assignments to provide learners with better instructions.

I’d advise to get a fresh copy of the assignment, by following the instructions under the heading Refreshing your Workspace.

Re-attempt the assignment. Read the markdown and exercise instructions carefully.

If after that you still encounter issues, as Tom mentioned, please share screenshots of the error you are getting.

Thanks,
Mubsi

1 Like

Thank you I will do it soon