Mistake in the Python loop in Exploring LLM Capabilities Lab

The example generates responses using repetition penalties of None, 1.2, and 2, but when printing the results it zips the responses with [0.3, 1.5, 3], which are temperature values from a previous example. As a result, the displayed “Repetition Penalty” values are incorrect and do not correspond to the parameters used to generate the responses.

You’re right, the print loop is using the temperature values from the previous cell ([0.3, 1.5, 3]) instead of the actual repetition penalty values ([None, 1.2, 2]).

The fix is straightforward. In the for loop, this line:

for i, (result, repetition_penalty) in enumerate(zip(results, [0.3, 1.5, 3])):

should be:

for i, (result, repetition_penalty) in enumerate(zip(results, [None, 1.2, 2])):

The generated responses themselves are fine since the repetition_penalty parameter was passed correctly in the list comprehension above. It’s only the display labels that are wrong.