mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 12:54:52 +00:00
Update __init__.py
Handle NoneType in sliding_window comparison to fix TypeError in __init__.py by ensuring the comparison logic accounts for NoneType values, preventing errors and improving code robustness.
This commit is contained in:
parent
bd4b23d0ba
commit
d7c5ef6cd2
@ -492,13 +492,7 @@ def get_model(
|
|||||||
)
|
)
|
||||||
sliding_window = config_dict.get("sliding_window", -1)
|
sliding_window = config_dict.get("sliding_window", -1)
|
||||||
|
|
||||||
if max_input_tokens is None:
|
if max_input_tokens is not None and (sliding_window is None or max_input_tokens <= sliding_window):
|
||||||
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
|
sliding_window = -1
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user