ONNX 模型库
返回模型

说明文档


license: cc-by-sa-4.0 base_model:

  • vikp/texify pipeline_tag: image-to-text

texify-fp16-onnx

https://huggingface.co/vikp/texify 的 fp16 ONNX 权重版本,感谢 https://huggingface.co/Xenova/texify

用法 (optimum[onnxruntime])

如果你还没有安装,可以通过 onnxruntime 后端安装 optimum:

pip install \"optimum[onnxruntime-gpu]\"

示例:

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

model = ORTModelForVision2Seq.from_pretrained(\"Spedon/texify-fp16-onnx\", provider=\"CUDAExecutionProvider\")
texify = pipeline(
    \"image-to-text\",
    model,
    feature_extractor=\"Spedon/texify-fp16-onnx\",
    image_processor=\"Spedon/texify-fp16-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$. \"}]
输入图像 可视化输出
image/png image/png

Spedon/texify-fp16-onnx

作者 Spedon

image-to-text
↓ 0 ♥ 0

创建时间: 2024-10-17 20:53:19+00:00

更新时间: 2024-10-17 21:09:15+00:00

在 Hugging Face 上查看

文件 (10)

.gitattributes
README.md
config.json
decoder_model_merged.onnx ONNX
encoder_model.onnx ONNX
generation_config.json
preprocessor_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json