mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 12:54:52 +00:00
Update __init__.py
Fix issue with NoneType comparison for max_input_tokens and sliding_window - Add default values for max_input_tokens and sliding_window to handle None cases. - Ensure the comparison between max_input_tokens and sliding_window is handled correctly to prevent TypeError. - This change addresses the error: TypeError: '<=' not supported between instances of 'int' and 'NoneType'.
This commit is contained in:
parent
a379d5536b
commit
bd4b23d0ba
@ -492,7 +492,13 @@ def get_model(
|
||||
)
|
||||
sliding_window = config_dict.get("sliding_window", -1)
|
||||
|
||||
if max_input_tokens is not None and max_input_tokens <= sliding_window:
|
||||
if max_input_tokens is None:
|
||||
max_input_tokens = 1024 # Set a default value if not provided
|
||||
|
||||
if sliding_window is None:
|
||||
sliding_window = 2048 # Set a default value if not provided
|
||||
|
||||
if max_input_tokens <= sliding_window:
|
||||
sliding_window = -1
|
||||
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user