We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dd0076 commit 44b5e41Copy full SHA for 44b5e41
bigcode_eval/utils.py
@@ -305,9 +305,12 @@ def complete_code(
305
num_return_sequences=batch_size,
306
**gen_kwargs,
307
)
308
- except ValueError:
+ except ValueError as e:
309
# When the length of input_ids == max_length, the generation is the same as the input
310
- generated_tokens = inputs
+ 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
+ generated_tokens = inputs
312
+ else:
313
+ raise e
314
315
# each task is generated batch_size times
316
generated_tasks = batch["task_id"].repeat(batch_size)
0 commit comments