GPT2 Support (#798)

* GPT-2 model support

* Add test for gpt2 model

* Fix weight sanitizing for quantization

* use approx gelu

---------

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
Derek Lewis
2024-06-02 16:33:20 -07:00
committed by GitHub
parent c457a3f88b
commit 89b0b75250
3 changed files with 225 additions and 0 deletions

View File

@@ -108,6 +108,8 @@ def linear_to_lora_layers(
elif model.model_type == "gpt_bigcode":
keys = set(["attn.c_attn"])
elif model.model_type == "gpt2":
keys = set(["attn.c_attn"])
elif model.model_type == "olmo":
keys = set(["att_proj"])
elif model.model_type == "openelm":