Skip to content

Commit 47281f9

Browse files
eaidovaecharlaix
andauthoredApr 25, 2024··
add olmo support (#678)
* add olmo support * disable test * Update optimum/exporters/openvino/model_configs.py Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> * Update tests/openvino/test_modeling.py Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> * format * format --------- Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
1 parent 41876fb commit 47281f9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
 

‎optimum/exporters/openvino/model_configs.py

+6
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ class OrionOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
441441
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
442442

443443

444+
@register_in_tasks_manager("olmo", *["text-generation", "text-generation-with-past"], library_name="transformers")
445+
class OlmoOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
446+
DEFAULT_ONNX_OPSET = 14
447+
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
448+
449+
444450
@register_in_tasks_manager(
445451
"phi3",
446452
*[

‎tests/openvino/test_modeling.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
528528
"mistral",
529529
"mixtral",
530530
"mpt",
531+
"olmo",
531532
"opt",
532533
"pegasus",
533534
"qwen",
@@ -542,7 +543,7 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
542543
"falcon-40b",
543544
)
544545
GENERATION_LENGTH = 100
545-
REMOTE_CODE_MODELS = ("chatglm", "minicpm", "baichuan2", "jais", "qwen", "internlm2", "olmo", "orion", "phi3")
546+
REMOTE_CODE_MODELS = ("chatglm", "minicpm", "baichuan2", "jais", "qwen", "internlm2", "orion", "phi3")
546547

547548
@parameterized.expand(SUPPORTED_ARCHITECTURES)
548549
def test_compare_to_transformers(self, model_arch):

‎tests/openvino/utils_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"mpt": "hf-internal-testing/tiny-random-MptForCausalLM",
7474
"mt5": "stas/mt5-tiny-random",
7575
"nystromformer": "hf-internal-testing/tiny-random-NystromformerModel",
76-
"olmo": "katuni4ka/tiny-random-olmo",
76+
"olmo": "katuni4ka/tiny-random-olmo-hf",
7777
"orion": "katuni4ka/tiny-random-orion",
7878
"pegasus": "hf-internal-testing/tiny-random-pegasus",
7979
"pix2struct": "fxmarty/pix2struct-tiny-random",

0 commit comments

Comments
 (0)
Please sign in to comment.