Skip to content
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

support phi 3 #27

Merged
merged 3 commits into from
Jun 20, 2024
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
1 change: 1 addition & 0 deletions gptqmodel/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .mpt import MPTGPTQ
from .opt import OPTGPTQ
from .phi import PhiGPTQ
from .phi3 import Phi3GPTQ
from .qwen import QwenGPTQ
from .qwen2 import Qwen2GPTQ
from .rw import RWGPTQ
Expand Down
1 change: 1 addition & 0 deletions gptqmodel/models/_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"mixtral",
"qwen2",
"phi",
"phi3",
"gemma",
"starcoder2",
"cohere",
Expand Down
2 changes: 2 additions & 0 deletions gptqmodel/models/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .mpt import MPTGPTQ
from .opt import OPTGPTQ
from .phi import PhiGPTQ
from .phi3 import Phi3GPTQ
from .qwen import QwenGPTQ
from .qwen2 import Qwen2GPTQ
from .rw import RWGPTQ
Expand Down Expand Up @@ -60,6 +61,7 @@
"longllama": LongLlamaGPTQ,
"gemma": GemmaGPTQ,
"phi": PhiGPTQ,
"phi3": Phi3GPTQ,
"mpt": MPTGPTQ,
"minicpm": MiniCPMGPTQ,
}
Expand Down
14 changes: 14 additions & 0 deletions gptqmodel/models/phi3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from .base import BaseGPTQModel


class Phi3GPTQ(BaseGPTQModel):
base_modules = ["model.embed_tokens", "embed_dropout", "model.norm"]

layers_node = "model.layers"
layer_type = "Phi3DecoderLayer"
layer_modules = [
["self_attn.qkv_proj"],
["self_attn.o_proj"],
["mlp.gate_up_proj"],
["mlp.down_proj"],
]
Loading