Skip to content

Add _is_stateful property to OVBaseDecoderModel #1121

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

Closed
wants to merge 1 commit into from

Conversation

notsyncing
Copy link

What does this PR do?

Hello, when I try assisted generation with optimum-intel and openvino, it complains about

AttributeError: 'OVModelForCausalLM' object has no attribute '_is_stateful'. Did you mean: '_make_stateful'?

After adding this property to OVBaseDecoderModel, the error is gone, and assisted generation works.

Before submitting

  • 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?

@IlyasMoutawwakil
Copy link
Member

hello @notsyncing sorry I just noticed this PR, is this still an issue ?

@notsyncing
Copy link
Author

hello @notsyncing sorry I just noticed this PR, is this still an issue ?

Yes, I'm manually patching it in my code, with latest optimum-intel git commit:

# original_model is an OVBaseDecoderModel
if hasattr(original_model, "stateful"):
   original_model._is_stateful = original_model.stateful

But I'm not sure if the PR is the way to fix this, there may be some more elegant solutions.

@IlyasMoutawwakil
Copy link
Member

IlyasMoutawwakil commented May 6, 2025

it seems to me that "_is_stateful" is no longer used in the lib https://github.com/search?q=repo%3Ahuggingface%2Foptimum-intel%20%22_is_stateful%22&type=code

@notsyncing
Copy link
Author

it seems to me that "_is_stateful" is no longer used in the lib https://github.com/search?q=repo%3Ahuggingface%2Foptimum-intel%20%22_is_stateful%22&type=code

Yes, you are right, I tested again without my patch, it still works.
I'm closing this PR.

@notsyncing notsyncing closed this May 6, 2025
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.

2 participants