I wrote the code and am trying to run it by pressing Shift+Enter. However, after doing so, it neither shows any errors nor displays any results. I’m having trouble understanding the issue-could you please clarify what might be going wrong. I have also done the ML course; it showed an error if there was any, but here there is neither an error nor is the code running. Could you please help me understand why this is happening? And am I doing something wrong? I am getting 0 when i am submitting my code but it is the correct code.
Adding first draft generation code
GRADED FUNCTION: generate_draft
### START CODE HERE ###
# Define your prompt here. A multi-line f-string is typically used for this.
prompt = <Code removed by mentor>
### END CODE HERE ###
# Get a response from the LLM by creating a chat with the client.
response = CLIENT.chat.completions.create(
model=model,
messages=[{"role": "user", "content": prompt}],
temperature=1.0,
)
return response.choices[0].message.content
### START CODE HERE ###
# Define your prompt here. A multi-line f-string is typically used for this.
prompt = < Code removed by mentor>
### END CODE HERE ###
# Get a response from the LLM by creating a chat with the client.
response = CLIENT.chat.completions.create(
model=model,
messages=[{"role": "user", "content": prompt}],
temperature=1.0
)
return response.choices[0].message.content
### START CODE HERE ###
# Define your prompt here. A multi-line f-string is typically used for this.
prompt = <Code removed by mentor.>
# Get a response from the LLM by creating a chat with the client.
response = < Code removed by mentor>
### END CODE HERE ###
return response.choices[0].message.content
@Antara31, I see from another thread that you were able to pass all tests, but that you are still getting a 0 when you submit.
I will delete the code snippets you shared, since it is against community guidelines to share code here, but as far as I can see, your code looks fine.
Some things to try:
1). From the kernel menu, choose Restart and Clear Output
2). Run all the cells in order, making sure you still are passing all the unit tests. Make sure to also run the cells at the end that put it all together and show you the results from all the steps. Make sure these look good, too.
3). From the File menu, choose Save and Checkpoint.
4). Submit your assignment
If you still get 0 on your assignment, please share here a screenshot of the error you are getting for your submission. You can look at the bottom of the assignment to see some screenshots showing you how to open the right panel, where you can see the results from your submissions.
Hello - I have a similar issue with Exercise 1 of the module 2 assignment. The code passes the tests but does not generate any output. I tried testing with a Print(response) line but that threw an error that name ‘response’ is not defined. As I understand, response is a variable name that is provided in the exercise. Thank you