File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1616 fetch-depth : 0
1717 - name : Secret Scanning
1818 uses : trufflesecurity/trufflehog@main
19+ with :
20+ extra_args : --only-verified
Original file line number Diff line number Diff line change 3434
3535
3636app = typer .Typer ()
37+ app = typer .Typer (pretty_exceptions_show_locals = False )
3738
3839logging_config = dict ( # noqa C408
3940 version = 1 ,
Original file line number Diff line number Diff line change @@ -269,6 +269,11 @@ def greedy_until(
269269 f"{ context_size + max_new_tokens = } which is greather than { self .max_length = } . Truncating context to { self .max_length - max_new_tokens } tokens."
270270 )
271271 context_size = self .max_length - max_new_tokens
272+ if context_size < 0 :
273+ logger .critical (
274+ f"{ context_size = } is less than 0, either reduce the max_new_tokens or increase model max length."
275+ )
276+ raise ValueError ("Context size is less than 0." )
272277 inputs = [input [- context_size :] for input in inputs ]
273278 else :
274279 if context_size > self .max_length :
You can’t perform that action at this time.
0 commit comments