Skip to content

Commit 5fd34b1

Browse files
Qwen3 causal lm (#2311)
* init * update * bug fixes * add qwen causal lm test * fix qwen3 tests
1 parent 6479bda commit 5fd34b1

File tree

5 files changed

+555
-5
lines changed

5 files changed

+555
-5
lines changed

keras_hub/api/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@
454454
from keras_hub.src.models.qwen3.qwen3_backbone import (
455455
Qwen3Backbone as Qwen3Backbone,
456456
)
457+
from keras_hub.src.models.qwen3.qwen3_causal_lm import (
458+
Qwen3CausalLM as Qwen3CausalLM,
459+
)
457460
from keras_hub.src.models.qwen3.qwen3_causal_lm_preprocessor import (
458461
Qwen3CausalLMPreprocessor as Qwen3CausalLMPreprocessor,
459462
)

keras_hub/src/models/qwen3/qwen3_attention.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _compute_attention(
303303
attention_mask = self._mask_sliding_window(
304304
attention_mask,
305305
cache_update_index=cache_update_index
306-
if cache_update_index
306+
if cache_update_index is not None
307307
else 0,
308308
)
309309
attention_scores = self._masked_softmax(

0 commit comments

Comments
 (0)