mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-26 12:32:10 +00:00
Enables Flash Attention in TGI for gemma models (#235)
This commit is contained in:
parent
9ae5ad5057
commit
c5e3881051
@ -694,10 +694,12 @@ class CausalLM(Model):
|
||||
"return_dict": True,
|
||||
}
|
||||
|
||||
if model.config.model_type in ["llama", "mistral", "starcoder2", "qwen2", "falcon"]:
|
||||
if model.config.model_type in ["llama", "mistral", "starcoder2", "qwen2", "falcon", "gemma"]:
|
||||
|
||||
if model.config.model_type not in ["falcon"]:
|
||||
kwargs["attn_softmax_bf16"] = True
|
||||
|
||||
if model.config.model_type not in ["gemma"]:
|
||||
kwargs["trim_logits"] = True
|
||||
|
||||
if os.getenv("USE_FLASH_ATTENTION", "false").lower() == "true":
|
||||
|
Loading…
Reference in New Issue
Block a user