Text Generation
PEFT
Safetensors
qwen2
unsloth
qwen
qwen2.5
information-extraction
trl
sft
conversational
Instructions to use RMunshi/librarian-qwen-extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use RMunshi/librarian-qwen-extractor with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio
How to use RMunshi/librarian-qwen-extractor with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RMunshi/librarian-qwen-extractor to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RMunshi/librarian-qwen-extractor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RMunshi/librarian-qwen-extractor to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="RMunshi/librarian-qwen-extractor", max_seq_length=2048, )
Model Card for librarian-qwen-extractor
This is the designated "Extraction Specialist" for the Dual-Student Paradigm in our Master's Thesis on PDF Distillation and Document Intelligence. It acts as the secondary routing engine, transforming raw markdown text grids into strict Pydantic JSON schemas.
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "RMunshi/librarian-qwen-extractor"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
prompt = "Extract the entities from this text into JSON:\nThe ACME 5000 is an industrial router running firmware 2.1."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Procedure & Pipeline Context
This model is fine-tuned explicitly to generate Chain-of-Thought (CoT) reasoning logs (<thought>) followed by structured JSON (json) extraction graphs.
In our intelligent routing architecture:
- Llama-Vision 11B (Student 1) analyzes document visuals and returns raw formatted grid markdown.
- Qwen-2.5 7B (Student 2 - This Model) digests that markdown and outputs high-fidelity JSON mappings.
Training Data
Trained on 870 pristine synthetically generated industrial PDF layouts distilled directly using GPT-4o and verified via OpenCV masking.
Training Curves
- Final Loss: Convergence at ~0.08
- Base Engine: Qwen 2.5 7B Instruct
- Optimization Framework: Unsloth + Weights & Biases telemetry
- Downloads last month
- -
Model tree for RMunshi/librarian-qwen-extractor
Base model
Qwen/Qwen2.5-7B Finetuned
Qwen/Qwen2.5-7B-Instruct Quantized
unsloth/Qwen2.5-7B-Instruct-bnb-4bit