Skip to content

Instantly share code, notes, and snippets.

@pulsejet
Created March 27, 2024 06:12
Show Gist options
  • Save pulsejet/47fb8835d9bba8f339b5d5fb2ab23bd9 to your computer and use it in GitHub Desktop.
Save pulsejet/47fb8835d9bba8f339b5d5fb2ab23bd9 to your computer and use it in GitHub Desktop.
Convert siglip to onnx
# 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