Downloads · 30 days
7
41% of all-time downloads
remodlai/lexiq-reader-3b
lexiq-reader-3b is a machine learning model from remodlai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
7
41% of all-time downloads
All-time downloads
17
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 99%
From the Hugging Face model README
Fine-tuned from Jina AI's ReaderLM-v2
Lexiq Reader 3B is a specialized 1.5B parameter language model optimized for converting raw HTML into clean, structured markdown and JSON. This model is fine-tuned from Jina AI's ReaderLM-v2 for enhanced performance in document processing pipelines.
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # or "cpu"
tokenizer = AutoTokenizer.from_pretrained("remodlai/lexiq-reader-3b")
model = AutoModelForCausalLM.from_pretrained("remodlai/lexiq-reader-3b").to(device)
# Create prompt
html = "<html><body><h1>Hello, world!</h1></body></html>"
messages = [{"role": "user", "content": f"Extract the main content from the given HTML and convert it to Markdown format.\n```html\n{html}\n```"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate
inputs = tokenizer.encode(prompt, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=1024, temperature=0, do_sample=False, repetition_penalty=1.08)
print(tokenizer.decode(outputs[0]))
This model has been fine-tuned for:
See deployment examples in the modal/ directory for serverless deployment with auto-scaling.
For high-throughput inference:
from vllm import LLM, SamplingParams
llm = LLM(model="remodlai/lexiq-reader-3b", max_model_len=256000, dtype='float16')
sampling_params = SamplingParams(temperature=0, top_k=1, max_tokens=8192)
This model is based on ReaderLM-v2 by Jina AI.
CC-BY-NC-4.0 - Non-commercial use only