Skip to content

Add support for Qwen3Guard-Stream model with OVModelForGuard - #1960

Open
p-wysocki wants to merge 4 commits into
huggingface:mainfrom
p-wysocki:model_guard
Open

Add support for Qwen3Guard-Stream model with OVModelForGuard#1960
p-wysocki wants to merge 4 commits into
huggingface:mainfrom
p-wysocki:model_guard

Conversation

@p-wysocki

Copy link
Copy Markdown

What does this PR do?

  • Qwen3Guard-Stream is an Qwen3 decoder with LM head replaced with four token classification heads
  • Existing feature-extraction doesn't work, because OVModelForFeatureExtraction.forward() only reads last hidden state
  • Introduced OVModelForGuard as an elegant solution - the alternative would be to significantly complicate OVModelForFeatureExtraction
  • The branch runs the actual model correctly for both stateless and stateful pipelines

Note

  • This is my first contribution to optimum-intel, so I'm open to any discussion and feedback

Ticket

  • CVS-191209

@p-wysocki p-wysocki changed the title Add support Qwen3Guard-Stream model with OVModelForGuard Add support for Qwen3Guard-Stream model with OVModelForGuard Aug 28, 2026
@p-wysocki

Copy link
Copy Markdown
Author

@rkazants @popovaan could you please review?

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.

1 participant