Skip to content

Conversation

@rkazants
Copy link
Collaborator

@rkazants rkazants commented Dec 18, 2025

What does this PR do?

Note: Currently, the model is a remote-code model for transformers "4.x.y" version.

Example of conversion cmd-line for arcee-ai/Trinity-Nano-Preview:

optimum-cli export openvino -m arcee-ai/Trinity-Nano-Preview Trinity-Nano-Preview --trust-remote-code

Example of inference for arcee-ai/Trinity-Nano-Preview using OpenVINO backend:

from transformers import AutoTokenizer
from optimum.intel.openvino import OVModelForCausalLM

model_path = "arcee-ai/Trinity-Nano-Preview"

tokenizer = AutoTokenizer.from_pretrained(model_path)
model = OVModelForCausalLM.from_pretrained(model_path, trust_remote_code=True)

# change input text as desired
input_text = "The capital of France is"
# tokenize the text
input_tokens = tokenizer(input_text, return_tensors="pt")
# generate output tokens
output = model.generate(**input_tokens, max_length=10)
# decode output tokens into text
output = tokenizer.batch_decode(output)
print(output[0])

Before submitting

  • [N/A] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@rkazants rkazants changed the title [OpenVINO] Support Arcee Trinity models collection [OpenVINO] Support Arcee Trinity (aka Afmoe) models collection Dec 18, 2025
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@nikita-savelyevv nikita-savelyevv added the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Dec 18, 2025
Copy link
Contributor

@nikita-savelyevv nikita-savelyevv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I observe that the export and inference takes a very long time. Could you please add the same warning as the one we've added recently for Zamba2?

Another issue is that weight quantization is very slow because there are 20k weight constants to quantize. I believe we had a similar issue for Qwen/Qwen3-30B-A3B until MoE merging was added to OpenVINO. Do you know, is it expected for the same approach to work for this model?

Also, please take a look at the failing tests.

library_name="transformers",
)
class AfmoeOpenVINOConfig(LlamaOpenVINOConfig):
MIN_TRANSFORMERS_VERSION = "4.55.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this architecture is already supported in transformers https://github.com/huggingface/transformers/blob/v5.0.0rc0/src/transformers/models/afmoe/modeling_afmoe.py I think we shouldn't add support to the remote code version. We would also need to add support to the latest transformers version (will open a PR for this soon)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @echarlaix, we have urgent request from customer for this model. optimum-intel doesn't support v5 transformers yet. I propose to proceed with remote-code support for v4 now.

@rkazants rkazants removed the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Jan 8, 2026
@IlyasMoutawwakil
Copy link
Member

thanks for the addition @rkazants
there are still some failures in export, can you check those please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants