optimum-intel icon indicating copy to clipboard operation
optimum-intel copied to clipboard

optionally enable export if not exported model provided

Open eaidova opened this issue 1 year ago • 4 comments

What does this PR do?

Fixes # (issue)

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?

eaidova avatar May 21 '24 15:05 eaidova

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.

@echarlaix @AlexKoff88 @helena-intel could you please review and merge before next optimum release?

ilya-lavrenov avatar May 27 '24 19:05 ilya-lavrenov

I don't have strong objections but I wonder if there is a more elegant way to do the same without introducing so much code that mostly duplicated Transformers logic. @echarlaix should know it better.

Also a test is required.

AlexKoff88 avatar May 28 '24 05:05 AlexKoff88

I don't have strong objections but I wonder if there is a more elegant way to do the same without introducing so much code that mostly duplicated Transformers logic. @echarlaix should know it better.

Also a test is required.

Yes I think we can simplify this by using find_files_matching_pattern like :

pattern = r"(.*)?openvino(.*)?\_model.xml"
ov_files = find_files_matching_pattern(
    model_name_or_path,
    pattern,
    subfolder=subfolder,
    use_auth_token=token,
    revision=revision,
)

export = len(ov_files) == 0

also used in https://github.com/huggingface/optimum-intel/pull/740 for the openvino pipelines

echarlaix avatar Jun 03 '24 16:06 echarlaix