From 8a56275f3f1ce128c2d5d570b7deefafb13a283d Mon Sep 17 00:00:00 2001 From: Ekaterina Aidova Date: Thu, 26 Dec 2024 12:58:06 +0400 Subject: [PATCH] support glm edge (#1089) * add support glm-egde models * update models list --- docs/source/openvino/models.mdx | 1 + optimum/exporters/openvino/model_configs.py | 15 +++++++++++++++ tests/openvino/test_modeling.py | 1 + tests/openvino/utils_tests.py | 1 + 4 files changed, 18 insertions(+) diff --git a/docs/source/openvino/models.mdx b/docs/source/openvino/models.mdx index 6b73b7bdeb..b9fb248400 100644 --- a/docs/source/openvino/models.mdx +++ b/docs/source/openvino/models.mdx @@ -49,6 +49,7 @@ Here is the list of the supported architectures : - Falcon - Flaubert - GLM-4 +- GLM-Edge - GPT-2 - GPT-BigCode - GPT-J diff --git a/optimum/exporters/openvino/model_configs.py b/optimum/exporters/openvino/model_configs.py index aca2359864..e52d4a3de3 100644 --- a/optimum/exporters/openvino/model_configs.py +++ b/optimum/exporters/openvino/model_configs.py @@ -2519,3 +2519,18 @@ def outputs(self) -> Dict[str, Dict[int, str]]: if self._behavior in [Qwen2VLConfigBehavior.VISION_EMBEDDINGS, Qwen2VLConfigBehavior.VISION_EMBEDDINGS_MERGER]: return {"last_hidden_state": {0: "seq_len"}} return {} + + +@register_in_tasks_manager( + "glm", + *[ + "feature-extraction", + "feature-extraction-with-past", + "text-generation", + "text-generation-with-past", + "text-classification", + ], + library_name="transformers", +) +class GLMOpenVINOConfig(LlamaOpenVINOConfig): + MIN_TRANSFORMERS_VERSION = "4.46.0" diff --git a/tests/openvino/test_modeling.py b/tests/openvino/test_modeling.py index 0f166a635c..f9235baae7 100644 --- a/tests/openvino/test_modeling.py +++ b/tests/openvino/test_modeling.py @@ -915,6 +915,7 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase): "exaone", "mistral-nemo", "minicpm3", + "glm", ) # gptq and awq install disabled for windows test environment diff --git a/tests/openvino/utils_tests.py b/tests/openvino/utils_tests.py index 2011e11f0c..02b81bfdc5 100644 --- a/tests/openvino/utils_tests.py +++ b/tests/openvino/utils_tests.py @@ -160,6 +160,7 @@ "xglm": "hf-internal-testing/tiny-random-XGLMForCausalLM", "xverse": "katuni4ka/tiny-random-xverse", "glm4": "katuni4ka/tiny-random-glm4", + "glm": "katuni4ka/tiny-random-glm-edge", "open-clip": "hf-internal-testing/tiny-open-clip-model", "open-clip-ov": "zofinka/tiny-open-clip-model", "st-bert": "sentence-transformers/all-MiniLM-L6-v2",