Completion of prepare_data.py file - 'max_length' was incorrectly defined

Hello, in the assignment of week 1, in the prepare_data.py file, I set the max_length to 128 as follows:

          ### BEGIN SOLUTION - DO NOT delete this comment for grading purposes
          max_length=128, # Replace None
          ### END SOLUTION - DO NOT delete this comment for grading purposes

then saved the python file then completed the assignment, but I got a 0/15 grade for the “Completion of prepare_data.py file” test. The report says: “Test 2 failed: ‘max_length’ was incorrectly defined. Please try again.”

I have tried re-saving and re-uploading the completed files multiple times (with the last cell of the notebook), but I always get the same grade. What is the issue?

1 Like

I have the same issue. Did you solve this?

The trick is to not hardcode the max length in. If I remember correctly, in the main notebook it is defined somewhere.

Using variables like this instead of hardcoding them allows to you have a single source where all your configurable variables are defined, so changing them there changes any reference to them in your entire project.

Actually you have passed the correct value. But it requires to be done in this way: max_length=max_seq_length

Hi I am doing it this way using the passed in variable, but I am still getting graded 0/15. Any suggestions as to what I am doing wrong would be appreciated. I have saved the .py file.