Skip to content
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

Conversion to ONXX #177

Open
jitesh0034 opened this issue Aug 21, 2024 · 4 comments
Open

Conversion to ONXX #177

jitesh0034 opened this issue Aug 21, 2024 · 4 comments

Comments

@jitesh0034
Copy link

Using this snippet to save pre-trained model locally -

from gliner import GLiNER
model  = GLiNER.from_pretrained("urchade/gliner_medium")
model.save_pretrained("gliner_medium")

post this, running script for onxx conversion as per documentation -
python GLiNER/convert_to_onnx.py --model_path gliner_medium/ --save_path gliner_onnx/ --quantize True

getting error on -
OSError: gliner_medium does not appear to have a file named config.json. Checkout 'https://huggingface.co/gliner_medium/tree/None' for available files.

Tried with changing file name from 'gliner_config.json' to 'config.json'
getting new error of -
ValueError: Unrecognized model in gliner_medium. Should have a `model_type` key in its config.json

@hari-ag00
Copy link

try the same onnx conversion in notebook version once, https://github.com/urchade/GLiNER/blob/main/examples/convert_to_onnx.ipynb

@hari-ag00
Copy link

and try to use earlier gliner version, latest gliner version has some bugs in onnx conversion

@jitesh0034
Copy link
Author

thanks @hari-ag00
Also, can you suggest the version for this? Currently, i am using '0.2.2'

@hari-ag00
Copy link

@jitesh0034 try using 0.2.3

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

No branches or pull requests

2 participants