Run this model with HF Jobs

Run OpenTensorLab/OCRia-1-W4A16-LLM-Compressor on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenTensorLab/OCRia-1-W4A16-LLM-Compressor. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/OpenTensorLab/OCRia-1-W4A16-LLM-Compressor on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/OpenTensorLab/OCRia-1-W4A16-LLM-Compressor. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Vishva R
Update model weights, configs, and auxiliary files
d8db4d8 verified
Raw History Blame Contribute Delete
2.54 kB
# Copyright (c) 2026 LlamaIndex, Inc. All rights reserved.
# Licensed under the OCRia-1 Model and Code License (LICENSE at the root of this repository).
# This is not open-source software: see the license for permitted uses.
"""Recover list items stored as HTML rows with a bullet-only first cell."""
import re
from .blocks import Block
_TABLE = re.compile(r"\s*<table\b[^>]*>(.*?)</table>\s*", re.I | re.S)
_ROW = re.compile(r"<tr\b[^>]*>(.*?)</tr>", re.I | re.S)
_CELL = re.compile(r"<(td|th)\b([^>]*)>(.*?)</\1>", re.I | re.S)
_TAG = re.compile(r"<[^>]*>")
_SPAN = re.compile(r"\b(?:rowspan|colspan)\s*=", re.I)
def split_bullet_tables(answer: str, blocks: list[Block]) -> list[Block]:
"""Keep raw content spans so existing cached word indices remain valid.
Every body row must contain exactly a literal bullet cell and a text cell.
An optional first header becomes a heading. Unparsed content or merged body
cells preserve the whole table, avoiding loss of words or table relationships.
"""
result = []
for block in blocks:
if block.type != "table":
result.append(block)
continue
table = _TABLE.fullmatch(answer[block.start : block.end])
if table is None or "<table" in table[1].lower():
result.append(block)
continue
body = table[1]
rows = list(_ROW.finditer(body))
pieces = []
bullets = 0
if _ROW.sub("", body).strip():
result.append(block)
continue
for index, row in enumerate(rows):
cells = list(_CELL.finditer(row[1]))
if _CELL.sub("", row[1]).strip():
break
if len(cells) == 1 and index == 0 and cells[0][1].lower() == "th":
kind, cell = "heading", cells[0]
elif (
len(cells) == 2
and _TAG.sub("", cells[0][3]).strip() in {"•", "●", "▪", "◦"}
and not any(_SPAN.search(cell[2]) for cell in cells)
):
kind, cell = "list", cells[1]
bullets += 1
else:
break
if not _TAG.sub("", cell[3]).strip():
break
offset = block.start + table.start(1) + row.start(1)
pieces.append(Block(kind, offset + cell.start(3), offset + cell.end(3)))
if bullets and len(pieces) == len(rows) and len(pieces) >= 2:
result.extend(pieces)
else:
result.append(block)
return result