add llamafy_qwen.py

This commit is contained in:
hiyouga committed 2023-10-08 22:05:36 +08:00
1 parent de5523449e
commit f9769cff8a
3 files changed
+187 -31

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ def load_model_and_tokenizer(
else:
logger.warning("Current model does not support RoPE scaling.")
# Set FlashAttention-2
# Set FlashAttention-2 and S^2-Attn
if model_args.flash_attn:
if getattr(config, "model_type", None) == "llama":
LlamaModule.LlamaAttention = LlamaPatches.LlamaFlashAttention2