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

Add telechat test #1111

Merged
merged 4 commits into from
Jan 20, 2025
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ Public tests/papers and ModelCloud's internal tests have shown that GPTQ is on-p
| Model | | | | | | | | | |
|------------------|----|----------------|----|------------------|----|------------|----|----|---|
| Baichuan | ✅ | Falcon | ✅ | Llama 1-3.3 | ✅ | OLMo2 | ✅ | Yi | ✅ |
| Bloom | ✅ | Gemma 2 | ✅ | Llama 3.2 VL | ✅ | Ovis 1.6 | ✅ | | |
| Bloom | ✅ | Gemma 2 | ✅ | Llama 3.2 VL | ✅ | Ovis 1.6 | ✅ | XVERSE | |
| ChatGLM | ✅ | GPTBigCod | ✅ | LongLLaMA | ✅ | Phi 1-4 | ✅ | | |
| CodeGen | ✅ | GPTNeoX | ✅ | MiniCPM3 | ✅ | Qwen | ✅ | | |
| Cohere 1-2 | ✅ | GPT-2 | ✅ | Mistral | ✅ | Qwen2 MoE | ✅ | | |
| DBRX Converted | ✅ | GPT-J | ✅ | Mixtral | ✅ | Qwen2 VL | ✅ | | |
| Deci | ✅ | Granite | ✅ | MobileLLM | ✅ | RefinedWeb | ✅ | | |
| DeepSeek-V2 | ✅ | GRIN-MoE | ✅ | MOSS | ✅ | StableLM | ✅ | | |
| DeepSeek-V2-Lite | ✅ | Hymba | ✅ | MPT | ✅ | StarCoder2 | ✅ | | |
| EXAONE 3.0 | ✅ | InternLM 1/2.5 | ✅ | OPT | ✅ | XVERSE | ✅ | | |
| EXAONE 3.0 | ✅ | InternLM 1/2.5 | ✅ | OPT | ✅ | TeleChat2 | ✅ | | |

## Platform and HW Support

Expand Down
1 change: 0 additions & 1 deletion gptqmodel/models/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
from .definitions.xverse import XverseGPTQ # noqa: E402
from .definitions.yi import YiGPTQ # noqa: E402


logger = setup_logger()

MODEL_MAP = {
Expand Down
2 changes: 1 addition & 1 deletion gptqmodel/models/definitions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
from .rw import RWGPTQ
from .stablelmepoch import StableLMEpochGPTQ
from .starcoder2 import Starcoder2GPTQ
from .telechat2 import TeleChat2GPTQ
from .xverse import XverseGPTQ
from .yi import YiGPTQ
from .telechat2 import TeleChat2GPTQ
3 changes: 2 additions & 1 deletion gptqmodel/models/definitions/telechat2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ..base import BaseGPTQModel
import torch

from ..base import BaseGPTQModel


class TeleChat2GPTQ(BaseGPTQModel):
# telechat2 requires custom model code
Expand Down
4 changes: 3 additions & 1 deletion gptqmodel/utils/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import torch
import math

import numpy as np
import torch


# helper method to get accurate parameter count for a gptq model
def tensor_parameters(
Expand Down
29 changes: 29 additions & 0 deletions tests/models/test_telechat2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2025 ModelCloud
# Contact: qubitium@modelcloud.ai, x.com/qubitium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from model_test import ModelTest


class TestTeleChat_2(ModelTest):
NATIVE_MODEL_ID = "/monster/data/model/TeleChat2-7B/" # "Tele-AI/TeleChat2-7B"
NATIVE_ARC_CHALLENGE_ACC = 0.3677
NATIVE_ARC_CHALLENGE_ACC_NORM = 0.3831
APPLY_CHAT_TEMPLATE = True
TRUST_REMOTE_CODE = True
BATCH_SIZE = 6
USE_VLLM = False


def test_telechat2(self):
self.quant_lm_eval()
Loading