Downloads · 30 days
8
33% of all-time downloads
camtr0n/unrender-qwen3-4b-lora-v3
unrender-qwen3-4b-lora-v3 is a machine learning model from camtr0n. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
LoRA adapters that reconstruct compilable LaTeX from a rendered PDF's extracted text, word boxes, and declared font names.
Downloads · 30 days
8
33% of all-time downloads
All-time downloads
24
Public
Repo size
70.2 MB
Likes
0
Public
Click a slice to open those files.
.safetensors58.8 MB · 84%
From the Hugging Face model README
LoRA adapters that reconstruct compilable LaTeX from a rendered PDF's extracted text, word boxes, and declared font names.
Standard PEFT adapters — load with transformers on any platform.
Qwen/Qwen3-4B-Instruct-2507, QLoRA over a 4-bit nf4 base| model | compiled | glyphs lost | same-line | right-align | recall | score |
|---|---|---|---|---|---|---|
| Qwen3-4B base (bf16) | 25/34 | 138 | 0.584 | 0.386 | 0.569 | 0.2486 |
| + LoRA v3 (this) | 27/34 | 299 | 0.641 | 0.395 | 0.578 | 0.2388 |
Given a PDF's extracted text, word boxes, and declared fonts, the model emits a single
.texthat compiles on the first XeLaTeX run with zero missing-character warnings. The rendered result matches the source page count, with matched word positions within N = 3pt.
N is calibrated by perturbation, not chosen: the residual error distribution is bimodal (~0 or ~8pt+), so any N in 1–7pt behaves identically.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
m = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
m = PeftModel.from_pretrained(m, "camtr0n/unrender-qwen3-4b-lora-v3").merge_and_unload()
Generation: do_sample=True, temperature=0.7, top_p=0.8, top_k=20, and
max_new_tokens at least 10000 — outputs are long and a tight cap truncates
mid-command.
Input is an extraction, not a raw PDF: page geometry, declared font names,
line boxes. See src/unrender/extract.py in the code repo for the exact format.