I have the same issue as already mentioned in April. I have completed all the questions in the assignment of module 3 and it shows the message “All tests passed”. But when I submit the assignment, it gives me grade of 0 for all exercises with following message: “There was a problem compiling the code from your notebook, please check that you saved before submitting. Details: name ‘response’ is not defined”
I tried several times to restart the kernel and clear the output → same issue. In the already mentioned issue I cannot find any solution. What can I do?
This is python generally means that you are using a variable which have not defined, perhaps you are calling a function with it but its not initialized!
As Gent mentioned, the issue has to do with variable definition.
Given that name of the variable is “response”, chances are that you are defining a variable using openai library.
In any case, the issue is that the variable you are defining is successfully being done in the assignment environment, but that library is not part of the autograder environment, hence the error, name ‘response’ is not defined”.
This should also tell you that you are doing something that was not part of the assignment instructions.
Please remove this from your assignment and the autograder should be able to then grade your assignment properly.
Thanks for the answer. But the variable “response” is given in exercise 2 in the already prepared code “response = get_llm_response(prompt)” - it is not defined by me. And in exercise 1 the variable is not even used and I get the same message “name response not defined”. I get the expected output from all the exercises - but for all the exercises I only get the grade 0/10 points. I don’t know why.
Susanne was indeed using the response variable in Ex 2 in a way that was not part of the instructions, and hence, not part of the autograder environment. They have been instructed to implement Ex 2 as per the exercise instructions.