Created
March 27, 2024 06:12
-
-
Save pulsejet/47fb8835d9bba8f339b5d5fb2ab23bd9 to your computer and use it in GitHub Desktop.
Convert siglip to onnx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://huggingface.co/google/siglip-base-patch16-256-multilingual | |
# install huggingface/transformers from source | |
# install optimum from this branch: https://github.com/huggingface/optimum/tree/xenova-add-siglip | |
# install onnx onnxruntime etc. | |
# Use T5 tokenizer fast and save_pretrained to get tokenizers.json | |
# https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5_fast.py | |
# clone xenova/transformers.js and use the script to convert model | |
# fix any errors that come up after this | |
# use opset 13 | |
# split multimodal in a second run | |
# quantized=True always |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment