OleehyO/latex-formulas
Viewer • Updated • 1.56M • 590 • 99
How to use lamm-mit/Cephalo-LaTeX-Phi-3-vision-128k-4b-alpha with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "image-to-text" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("image-to-text", model="lamm-mit/Cephalo-LaTeX-Phi-3-vision-128k-4b-alpha", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("lamm-mit/Cephalo-LaTeX-Phi-3-vision-128k-4b-alpha", trust_remote_code=True, dtype="auto")Cephalo is a series of multimodal materials science focused vision large language models (V-LLMs) designed to integrate visual and linguistic data for advanced understanding and interaction in human-AI or multi-agent AI frameworks.
This version of Cephalo, lamm-mit/Cephalo-LaTeX-Phi-3-vision-128k-4b-alpha, is trained to convert images of equations to LaTeX code.