ONNX Model Zoo

Spedon/texify-quantized-onnx

By Spedon · ↓ 0 · ♥ 0 · Updated 2024-10-17

What's in this repo

This page lists the files in Spedon/texify-quantized-onnx, including decoder_model_merged_quantized.onnx, encoder_model_quantized.onnx.

  • 2 ONNX models (.onnx files)
  • 13 files, including 7 .json, 2 .md, 2 .onnx
  • Last updated 2024-10-17

ONNX files

File Size Download
decoder_model_merged_quantized.onnx — Download
encoder_model_quantized.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

texify-quantized-onnx

https://huggingface.co/vikp/texify with quantized ONNX weights, shoutout to https://huggingface.co/Xenova/texify

Usage (optimum[onnxruntime])

If you haven't already, you can install the optimum with the onnxrumtime backend

pip install "optimum[onnxruntime]"

Example:

from optimum.onnxruntime import ORTModelForVision2Seq
from optimum.pipelines import pipeline

model = ORTModelForVision2Seq.from_pretrained("Spedon/texify-quantized-onnx")
texify = pipeline(
    "image-to-text",
    model,
    feature_extractor="Spedon/texify-quantized-onnx",
    image_processor="Spedon/texify-quantized-onnx",
)
image = (
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/latex.png"
)
latex = texify(image, max_new_tokens=384)
print(latex)
# [{'generated_text': "The potential $V_i$ of cell $\\mathcal{C}_i$ centred at position $\\mathbf{r}_i$ is related to the surface charge densities $\\sigma_j$ of cells $\\mathcal{C}_j$ $j\\in[1,N]$ through the superposition principle as: $$V_i\\,=\\,\\sum_{j=0}^{N}\\,\\frac{\\sigma_j}{4\\pi\\varepsilon_0}\\,\\int_{\\mathcal{C}_j}\\frac{1}{\\|\\mathbf{r}_i-\\mathbf{r}'\\|}\\,\\mathrm{d}^2\\mathbf{r}'\\,=\\,\\sum_{j=0}^{N}\\,Q_{ij}\\,\\sigma_j,$$ where the integral over the surface of cell $\\mathcal{C}_j$ only depends on $\\mathcal{C}_j$ shape and on the relative position of the target point $\\mathbf{r}_i$ with respect to $\\mathcal{C}_j$ location, as $\\sigma_j$ is assumed constant over the whole surface of cell $\\mathcal{C}_j$. "}]
Input image Visualized output
image/png image/png

Model info

onnx vision-encoder-decoder image-to-text base_model:vikp/texify base_model:quantized:vikp/texify license:cc-by-sa-4.0 region:us
↓ 0 ♥ 0

Created: 2024-10-05

Updated: 2024-10-17

View on Hugging Face

Files (13)

.gitattributes
.gitignore
README.md
config.json
encoder_model_quantized.onnx ONNX
generation_config.json
ort_config.json
preprocessor_config.json
quantize_steps.md
special_tokens_map.json
tokenizer.json
tokenizer_config.json

Related models