Unverified Commit 82d19d77 authored by drbh's avatar drbh Committed by GitHub
Browse files

Pr 2374 ci branch (#2378)



* 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'.

* 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.

* fix: syntax/style tweak

---------
Co-authored-by: default avatarPraz <prazanth2006@gmail.com>
parent a379d553
......@@ -490,7 +490,12 @@ def get_model(
raise RuntimeError(
"Sharding is currently not supported with `exl2` quantization"
)
sliding_window = config_dict.get("sliding_window", -1)
sliding_window = (
config_dict.get("sliding_window")
if config_dict.get("sliding_window") is not None
else -1
)
if max_input_tokens is not None and max_input_tokens <= sliding_window:
sliding_window = -1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment