Image-Text-to-Text
Transformers
Joblib
Safetensors
nemotron_parse
text-generation
document-parsing
ocr
tables
charts
ground-truth-sft
grpo
verifiable-rewards
routed-refinement
thrisul
conversational
custom_code
Instructions to use sandeeprdy1729/thrisul-parser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sandeeprdy1729/thrisul-parser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sandeeprdy1729/thrisul-parser", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("sandeeprdy1729/thrisul-parser", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sandeeprdy1729/thrisul-parser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sandeeprdy1729/thrisul-parser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sandeeprdy1729/thrisul-parser", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/sandeeprdy1729/thrisul-parser
- SGLang
How to use sandeeprdy1729/thrisul-parser with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sandeeprdy1729/thrisul-parser" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sandeeprdy1729/thrisul-parser", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sandeeprdy1729/thrisul-parser" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sandeeprdy1729/thrisul-parser", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use sandeeprdy1729/thrisul-parser with Docker Model Runner:
docker model run hf.co/sandeeprdy1729/thrisul-parser
File size: 3,890 Bytes
37fb2b9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: OpenMDW-1.1
"""Decode known rich inline commands for the legacy tabular fallback.
Used only after strict rich-grid parsing fails. This preserves unknown commands
and malformed arguments; it never invents cell contents or repairs table spans.
"""
import html
import re
try:
from .hybrid_cleanup import decode_styles
except ImportError:
from hybrid_cleanup import decode_styles
try:
from .rich_table_reader import TAGS, LITERALS, argument
except ImportError:
from rich_table_reader import TAGS, LITERALS, argument
def decode_known_inline(text, _depth=0):
"""Decode balanced, recognized inline arguments without exposing delimiters."""
if _depth > 64:
return text
out = []
i = 0
known = set(TAGS) | set(LITERALS) | {"thead", "linebreak", "mbox", "hl", "colorbox"}
while i < len(text):
# Preserve escaped literal characters. In particular, an escaped
# backslash followed by 'thead' must not become a formatting command.
if text[i] == "\\" and i + 1 < len(text) and not text[i + 1].isalpha():
literal = text[i + 1]
out.append(
"\\&#" + str(ord(literal)) + ";"
if literal in "&%$#_*{}"
else text[i : i + 2]
)
i += 2
continue
match = re.match(r"\\([A-Za-z]+)\{", text[i:])
if not match or match[1] not in known:
out.append(text[i])
i += 1
continue
command = match[1]
try:
body, end = argument(text, i + len(command) + 1)
except ValueError:
out.append(text[i])
i += 1
continue
if command in {"hl", "colorbox"}:
try:
from .semantic_styles import mark_open
except ImportError:
from semantic_styles import mark_open
from bs4 import BeautifulSoup
node = BeautifulSoup("<mark></mark>", "html.parser").mark
if command == "colorbox":
node["background"] = body
try:
body, end = argument(text, end)
except ValueError:
out.append(text[i:end])
i = end
continue
out.append(
mark_open(node) + decode_known_inline(body, _depth + 1) + "</mark>"
)
elif command in TAGS or command == "thead":
inner = decode_known_inline(body, _depth + 1)
tag = "nvp-header-cell" if command == "thead" else TAGS[command]
out.append("<" + tag + ">" + inner + "</" + tag + ">")
elif command in LITERALS and not body:
# Entities cannot be mistaken for LaTeX row/column delimiters.
out.append("\\&#" + str(ord(LITERALS[command])) + ";")
elif command == "linebreak" and not body:
out.append("<nvp-line-break></nvp-line-break>")
elif command == "mbox" and not body:
pass
else:
out.append(text[i:end])
i = end
return decode_styles("".join(out))
def restore_header_cells(html_text):
from bs4 import BeautifulSoup
# Restore explicit breaks after legacy whitespace normalization, which
# otherwise collapses consecutive linebreak commands.
html_text = html_text.replace("<nvp-line-break></nvp-line-break>", "<br>")
if "<nvp-header-cell>" not in html_text:
return html_text
soup = BeautifulSoup(html_text, "html.parser")
for cell in soup.find_all(["td", "th"]):
markers = cell.find_all("nvp-header-cell")
if markers:
cell.name = "th"
for marker in markers:
marker.unwrap()
return str(soup)
|