Skip to content

Commit c165bb8

Browse files
committed
Adding warning when we catch this error to notify user of behavior
1 parent 44b5e41 commit c165bb8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bigcode_eval/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def complete_code(
308308
except ValueError as e:
309309
# When the length of input_ids == max_length, the generation is the same as the input
310310
if str(e).startswith(f"Input length of input_ids is {inputs.shape[1]}, but `max_length` is set to {gen_kwargs['max_length']}"):
311+
warnings.warn(f"An error with the following message was thrown: {e}. Returning the input as the generation.")
311312
generated_tokens = inputs
312313
else:
313314
raise e

0 commit comments

Comments
 (0)