Skip to content

Qwen3 causal lm #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions keras_hub/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@
from keras_hub.src.models.qwen3.qwen3_backbone import (
Qwen3Backbone as Qwen3Backbone,
)
from keras_hub.src.models.qwen3.qwen3_causal_lm import (
Qwen3CausalLM as Qwen3CausalLM,
)
from keras_hub.src.models.qwen3.qwen3_causal_lm_preprocessor import (
Qwen3CausalLMPreprocessor as Qwen3CausalLMPreprocessor,
)
Expand Down
4 changes: 2 additions & 2 deletions keras_hub/src/models/qwen3/qwen3_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ def _compute_attention(
attention_scores,
ops.cast(self._inv_norm_factor, self.compute_dtype),
)
if not self.sliding_window_size:
if self.sliding_window_size:
attention_mask = self._mask_sliding_window(
attention_mask,
cache_update_index=cache_update_index
if cache_update_index
if cache_update_index is not None
else 0,
)
attention_scores = self._masked_softmax(
Expand Down
Loading
Loading