fix conflict with quant kv (#11737)

This commit is contained in:
Yina Chen 2024-08-07 13:10:30 +03:00 committed by GitHub
parent 00a5574c8a
commit e956e71fc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,8 +123,8 @@ def qwen2_model_forward(
if use_cache:
if use_quantize_kv and not isinstance(past_key_values, DynamicFp8Cache):
past_key_values = DynamicFp8Cache.from_legacy_cache(past_key_values)
elif use_compress_kv and not isinstance(past_key_values,
DynamicCompressCache):
elif not use_quantize_kv and use_compress_kv and not isinstance(past_key_values,
DynamicCompressCache):
past_key_values = DynamicCompressCache.from_legacy_cache(past_key_values)
if not use_quantize_kv and not use_compress_kv and not isinstance(past_key_values,
(DynamicNormalCache,