Instructions to use davidepanza/qwen3-0.6b-instruct-chapter-extraction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davidepanza/qwen3-0.6b-instruct-chapter-extraction with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="davidepanza/qwen3-0.6b-instruct-chapter-extraction") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("davidepanza/qwen3-0.6b-instruct-chapter-extraction") model = AutoModelForCausalLM.from_pretrained("davidepanza/qwen3-0.6b-instruct-chapter-extraction") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use davidepanza/qwen3-0.6b-instruct-chapter-extraction with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davidepanza/qwen3-0.6b-instruct-chapter-extraction" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davidepanza/qwen3-0.6b-instruct-chapter-extraction", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/davidepanza/qwen3-0.6b-instruct-chapter-extraction
- SGLang
How to use davidepanza/qwen3-0.6b-instruct-chapter-extraction 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 "davidepanza/qwen3-0.6b-instruct-chapter-extraction" \ --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": "davidepanza/qwen3-0.6b-instruct-chapter-extraction", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "davidepanza/qwen3-0.6b-instruct-chapter-extraction" \ --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": "davidepanza/qwen3-0.6b-instruct-chapter-extraction", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use davidepanza/qwen3-0.6b-instruct-chapter-extraction 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 davidepanza/qwen3-0.6b-instruct-chapter-extraction 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 davidepanza/qwen3-0.6b-instruct-chapter-extraction to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for davidepanza/qwen3-0.6b-instruct-chapter-extraction to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="davidepanza/qwen3-0.6b-instruct-chapter-extraction", max_seq_length=2048, ) - Docker Model Runner
How to use davidepanza/qwen3-0.6b-instruct-chapter-extraction with Docker Model Runner:
docker model run hf.co/davidepanza/qwen3-0.6b-instruct-chapter-extraction
Model Card for Model ID
Model Details
Model Description
This is a fine-tuned Qwen3-0.6B model specialized for extracting chapter information and table of contents from documents. The model has been trained to identify and structure chapter titles, sections, and document hierarchies.
- Developed by: Davide Panza
- Model type: Causal Language Model (Fine-tuned for Text Extraction)
- License: Apache 2.0
- Finetuned from model: unsloth/Qwen3-0.6B-unsloth-bnb-4bit
Model Sources [optional]
Uses
- Extract chapter titles and section headings from documents
- Generate structured table of contents
Training Details
Training Data
synthetic data
repo: https://github.com/DavidePanza/finetuning_LLM_for_Chapter_Extraction/tree/main/data/training_dataset
Training Procedure
- Base Model: Qwen3-0.6B (via Unsloth's optimized 4-bit version)
- Training Framework: Unsloth with SFTTrainer
- Fine-tuning Method: Supervised Fine-Tuning (SFT) with LoRA
- Precision: 16-bit merged (from 4-bit quantized base)
Training Hyperparameters
- Training regime:
- Epochs: 2
- Batch Size: 4 (per device)
- Gradient Accumulation Steps: 2 (effective batch size: 8)
- Learning Rate: 5e-5
- Optimizer: AdamW 8-bit
- Weight Decay: 0.001
- LR Scheduler: Cosine with warmup
- Warmup Steps: 100
- Max Gradient Norm: 1.0 (gradient clipping)
- Mixed Precision: FP16 enabled
- Logging Steps: 10
- Downloads last month
- 9