Skip to content

Add Qwen Moe #2163

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

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions keras_hub/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@
from keras_hub.src.models.qwen.qwen_tokenizer import (
QwenTokenizer as Qwen2Tokenizer,
)
from keras_hub.src.models.qwen_moe.qwen_moe_backbone import QwenMoeBackbone
from keras_hub.src.models.qwen_moe.qwen_moe_causal_lm import QwenMoeCausalLM
from keras_hub.src.models.qwen_moe.qwen_moe_causal_lm_preprocessor import (
QwenMoeCausalLMPreprocessor,
)
from keras_hub.src.models.qwen.qwen_tokenizer import (
QwenTokenizer as QwenTokenizer,
)
Expand Down
4 changes: 3 additions & 1 deletion keras_hub/src/models/qwen/qwen_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def _compute_attention(
if self.use_sliding_window_attention:
attention_mask = self._mask_sliding_window(
attention_mask,
cache_update_index=cache_update_index,
cache_update_index=cache_update_index
if cache_update_index
else 0,
)
attention_scores = self._masked_softmax(
attention_scores, attention_mask
Expand Down
Empty file.
Loading
Loading