error

#2
by ahmetyusa - opened

Because there are multiple bin and xml files, ovmModelcasualLLM cannot read them and I get an error. I want to use it for text.

Please provide the error. Note: from pretrained accepts either an ID from the hub, or the top level path to your model, note any specific openvino_ file.

->text only

This requires some preprocessing. Behind the scenes AutoProcessor handles the interface with a given models tokenizer

More specifically,

if images:
    inputs = self.processor(
        text=[text_prompt],
        images=[images],
        padding=True, 
        return_tensors="pt",
        add_generation_prompt=True
    )
else:
    inputs = self.processor(
        text=[text_prompt],
        padding=True, 
        return_tensors="pt",
        add_generation_prompt=True
    )

See a more complete example in optimum_image2text.py. Base64 was chosen for consistency with other API design choices and intended usecases.

Models with multiple components are always converted to OpenVINO IR this way. see

https://huggingface.co/OpenVINO/Phi-3.5-vision-instruct-int4-ov/tree/main

and

https://huggingface.co/OpenVINO/stable-diffusion-v1-5-fp16-ov/tree/main, which follows the Diffusers format.

I get this error

RuntimeError: Exception from src\inference\src\cpp\core.cpp:95: Check 'util::directory_exists(path) || util::file_exists(path)' failed at src\frontends\common\src\frontend.cpp:117: FrontEnd API failed with GeneralFailure: ir: Could not open the file: "C:\Users\yusa.koc.cache\huggingface\hub\models--Echo9Zulu--gemma-3-4b-it-int8_asym-ov\snapshots\13a4bea3e472c60b1834f98932e11d548f715a6f\openvino_model.xml"

or
ı added script to same directory with optimum _text2text.py

ImportError: attempted relative import with no known parent package

Sign up or log in to comment