This model was exported from open-clip using the SparseML integration.
git clone https://github.com/neuralmagic/sparseml
pip install -e sparseml[clip]
python sparseml/integrations/clip/clip_onnx_export.py --model ViT-B-32 --pretrained laion2b_s34b_b79k --export-path onnx
import onnx
from onnx import helper
from onnx import TensorProto
# Define the new input tensor
model_path = 'onnx/clip_text.onnx'
model = onnx.load(model_path)
new_input = helper.make_tensor_value_info(
'input_1',
TensorProto.INT64,
['batch']
)
model.graph.input.append(new_input)
onnx.save(model, 'modified_model.onnx')
3 commits
This model was exported from open-clip using the SparseML integration.
git clone https://github.com/neuralmagic/sparseml
pip install -e sparseml[clip]
python sparseml/integrations/clip/clip_onnx_export.py --model ViT-B-32 --pretrained laion2b_s34b_b79k --export-path onnx
import onnx
from onnx import helper
from onnx import TensorProto
# Define the new input tensor
model_path = 'onnx/clip_text.onnx'
model = onnx.load(model_path)
new_input = helper.make_tensor_value_info(
'input_1',
TensorProto.INT64,
['batch']
)
model.graph.input.append(new_input)
onnx.save(model, 'modified_model.onnx')
3 commits