alt.freeweights.vision / nougat-latex-base
From: Norm <huggingface.co/Norm>Newsgroups: alt.freeweights.visionSubject:

nougat-latex-base

Date: 2026-11-15Commit: 6c6f2afSigned: 2DC28CC7B26A283B ✓

Image to text model with 349M parameters. Safetensors weights, 2.79 GB in all. Published by Norm under Apache-2.0.

349M params2.79GBnougat-latex-basesafetensorspermissive
FactsParams349MSize2.79 GBFormatssafetensorsTaskimage to textLicenseApache-2.0From sourcepermissive
$ fw get Norm/nougat-latex-base
# manifest sha256 971b7eea9068… · 2.79 GB · 10 files
$ fw verify ./nougat-latex-base Norm/nougat-latex-base
From sourceHosted (signed)Norm/nougat-latex-baseLast check: 2026-11-15 02:51 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
2.79 GB
Weights
1.40 GB (safetensors)
Parameters
349M
Formats
safetensors
Task
image to text
License
Apache-2.0 (permissive)
Files
10, each with a sha256
Publisher
Norm
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:51 UTCpassed

Model card

From the publisher at commit 6c6f2af. Shown as plain text with links; images open at the publisher.

Nougat-LaTeX-based#

Nougat-LaTeX-based is fine-tuned from facebook/nougat-base with im2latex-100k to boost its proficiency in generating LaTeX code from images. Since the initial encoder input image size of nougat was unsuitable for equation image segments, leading to potential rescaling artifacts that degrades the generation quality of LaTeX code. To address this, Nougat-LaTeX-based adjusts the input resolution and uses an adaptive padding approach to ensure that equation image segments in the wild are resized to closely match the resolution of the training data.

Evaluation#

Evaluated on an image-equation pair dataset collected from Wikipedia, arXiv, and im2latex-100k, curated by lukas-blecher

modeltoken_acc ↑normed edit distance ↓
pix2tex0.53460.10312
pix2tex*0.600.10
nougat-latex-based0.6238500.06180

pix2tex is a ResNet + ViT + Text Decoder architecture introduced in LaTeX-OCR.

pix2tex*: reported from LaTeX-OCR; pix2tex: my evaluation with the released checkpoint ; nougat-latex-based: evaluated on results generated with beam-search strategy.

Requirements#

pip install transformers >= 4.34.0

Uses#

The inference API widget sometimes cuts the response short. Please check this issue for more details. You may want to run the model yourself in case the inference API bug cuts the results short.

  1. Download the repo
git clone git@github.com:NormXU/nougat-latex-ocr.git
cd ./nougat-latex-ocr
  1. Inference
import torch
from PIL import Image
from transformers import VisionEncoderDecoderModel
from transformers.models.nougat import NougatTokenizerFast
from nougat_latex import NougatLaTexProcessor

model_name = "Norm/nougat-latex-base"
device = "cuda" if torch.cuda.is_available() else "cpu"
# init model
model = VisionEncoderDecoderModel.from_pretrained(model_name).to(device)

# init processor
tokenizer = NougatTokenizerFast.from_pretrained(model_name)

latex_processor = NougatLaTexProcessor.from_pretrained(model_name)

# run test
image = Image.open("path/to/latex/image.png")
if not image.mode == "RGB":
    image = image.convert('RGB')

pixel_values = latex_processor(image, return_tensors="pt").pixel_values

decoder_input_ids = tokenizer(tokenizer.bos_token, add_special_tokens=False,
                              return_tensors="pt").input_ids
with torch.no_grad():
    outputs = model.generate(
        pixel_values.to(device),
        decoder_input_ids=decoder_input_ids.to(device),
        max_length=model.decoder.config.max_length,
        early_stopping=True,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
        use_cache=True,
        num_beams=5,
        bad_words_ids=[[tokenizer.unk_token_id]],
        return_dict_in_generate=True,
    )
sequence = tokenizer.batch_decode(outputs.sequences)[0]
sequence = sequence.replace(tokenizer.eos_token, "").replace(tokenizer.pad_token, "").replace(tokenizer.bos_token, "")
print(sequence)

Files

10 files · 2.79 GBWeights 1.40 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 10 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md3.80 KB8dc8c78eb2a75c01db84c33ee8b0f2264325e1cb0bdea4eeb8bcd6cae8954c7d
config.json4.84 KB462b1a02aca816bd084afc14dcd19fc320a3293fa5bae6ec0c8f8c0b3fef6556
generation_config.json165 B1391e25be2ec036d70536dbb78513ff95aa2b626880f42fb8f54b612db98ce09
model.safetensors1.40 GB8744044b022287b7bcac669332c9901a3bdfd02c07a1c93f551ecc9700c828a7
preprocessor_config.json439 B91d668bdcbeccee3a816ae8568d6099cf57fcf461608df4e7846eed7f20aabfa
pytorch_model.bin1.40 GBa35a900b0d8b2e0e6e6eaa1a0787bf5e8dbc7b78aad3bead7a1afdf6d7f8ff96
special_tokens_map.json96 B9046da57c270c8e74d0f38832b4adce269c9d914ef21d2a0925e7772152dd793
tokenizer.json2.14 MB5206bef946bfe9981af5d61bf993b52950a4ebc29f1c0256cc113a1698448536
tokenizer_config.json4.49 KB6db75f8174b27dd3649a79cf0603fd1c87a040f8431dc15f0f408ccbf22c74a6
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
6c6f2afe62 pinned now2026-11-15 02:51 UTC10 files · 2.79 GB

Use it

$ fw get Norm/nougat-latex-base
# manifest sha256 971b7eea9068… · 2.79 GB · 10 files
$ fw verify ./nougat-latex-base Norm/nougat-latex-base
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/Norm/nougat-latex-base.json --dir ./nougat-latex-base $ python3 fw.py verify ./nougat-latex-base ./Norm__nougat-latex-base.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download Norm/nougat-latex-base --revision 6c6f2afe62ae51d57d0621ea9f2e11e02fb8385a --local-dir ./nougat-latex-base

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
8dc8c78eb2a75c01db84c33ee8b0f2264325e1cb0bdea4eeb8bcd6cae8954c7d
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: Norm <huggingface.co/Norm>Newsgroups: alt.freeweights.visionSubject: nougat-latex-baseDate: 2026-11-15Commit: 6c6f2afSigned: 2DC28CC7B26A283B ✓
Upstream
Norm/nougat-latex-base
Pinned commit
6c6f2afe62ae51d57d0621ea9f2e11e02fb8385a
Manifest
nougat-latex-base.json · .minisig
Manifest sha256
971b7eea9068902959453306bbd1ca3266c224cdd101996e5dd6c4c45d989c97
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:51 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/Norm/nougat-latex-base.json $ curl -O https://freeweights.allternit.com/manifests/Norm/nougat-latex-base.json.minisig $ minisign -Vm nougat-latex-base.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download Norm/nougat-latex-base
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. nougat-latex-base.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of nougat-latex-base. Each has its own license check and page.

From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX