Text Generation
Transformers
TensorBoard
Safetensors
qwen3
Generated from Trainer
trl
sft
trackio
conversational
text-generation-inference
Run this model with HF Jobs
Run OmAlve/reading-steiner 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/OmAlve/reading-steiner. 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/OmAlve/reading-steiner 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/OmAlve/reading-steiner. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OmAlve/reading-steiner. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OmAlve/reading-steiner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OmAlve/reading-steiner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OmAlve/reading-steiner") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OmAlve/reading-steiner") model = AutoModelForCausalLM.from_pretrained("OmAlve/reading-steiner", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OmAlve/reading-steiner with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OmAlve/reading-steiner" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OmAlve/reading-steiner", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OmAlve/reading-steiner
- SGLang
How to use OmAlve/reading-steiner 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 "OmAlve/reading-steiner" \ --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": "OmAlve/reading-steiner", "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 "OmAlve/reading-steiner" \ --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": "OmAlve/reading-steiner", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OmAlve/reading-steiner with Docker Model Runner:
docker model run hf.co/OmAlve/reading-steiner
Copy train_indexlm.py from IndexLM-0.6B
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137"""IndexLM Training Script - Fine-tune Qwen3-0.6B for Index-based Web Content Extraction
Based on: "An Index-based Approach for Efficient and Effective Web Content Extraction" (arxiv:2512.06641)Base model: Qwen/Qwen3-0.6B (0.6B params, ideal for CPU deployment)Training method: SFT with TRL SFTTrainerDataset: OmAlve/indexlm-training-data (25K+ examples)"""
import osimport torchfrom datasets import load_datasetfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom trl import SFTTrainer, SFTConfigimport trackio
# ============ Configuration ============MODEL_ID = "Qwen/Qwen3-0.6B"DATASET_ID = "OmAlve/indexlm-training-data"OUTPUT_DIR = "./indexlm-0.6b"HUB_MODEL_ID = "OmAlve/IndexLM-0.6B"
# Training hyperparameters (from paper: standard SFT)LEARNING_RATE = 2e-5NUM_EPOCHS = 3BATCH_SIZE = 4GRAD_ACCUM = 4 # Effective batch size = 16MAX_SEQ_LENGTH = 4096WARMUP_RATIO = 0.05
# ============ Setup Trackio ============trackio.init( name="indexlm-0.6b-training", project="indexlm")
# ============ Load Dataset ============print("Loading dataset...")dataset = load_dataset(DATASET_ID)train_dataset = dataset["train"]eval_dataset = dataset["eval"]print(f"Train: {len(train_dataset)}, Eval: {len(eval_dataset)}")
# ============ Load Model & Tokenizer ============print("Loading model and tokenizer...")tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
# Ensure padding token is setif tokenizer.pad_token is None: tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained( MODEL_ID, torch_dtype=torch.bfloat16, attn_implementation="flash_attention_2",)
print(f"Model loaded: {MODEL_ID}")print(f"Model params: {sum(p.numel() for p in model.parameters()) / 1e6:.1f}M")
# ============ Training Config ============training_args = SFTConfig( output_dir=OUTPUT_DIR, num_train_epochs=NUM_EPOCHS, per_device_train_batch_size=BATCH_SIZE, per_device_eval_batch_size=BATCH_SIZE, gradient_accumulation_steps=GRAD_ACCUM, learning_rate=LEARNING_RATE, lr_scheduler_type="cosine", warmup_ratio=WARMUP_RATIO, weight_decay=0.01, bf16=True, gradient_checkpointing=True, max_length=MAX_SEQ_LENGTH, # Logging logging_steps=10, logging_first_step=True, logging_strategy="steps", disable_tqdm=True, # Evaluation eval_strategy="steps", eval_steps=500, # Saving save_strategy="steps", save_steps=500, save_total_limit=3, load_best_model_at_end=True, metric_for_best_model="eval_loss", greater_is_better=False, # Hub push push_to_hub=True, hub_model_id=HUB_MODEL_ID, hub_strategy="every_save", # Performance dataloader_num_workers=4, dataloader_pin_memory=True, # Report report_to="none", # Seed seed=42,)
# ============ Initialize Trainer ============print("Initializing trainer...")trainer = SFTTrainer( model=model, args=training_args, train_dataset=train_dataset, eval_dataset=eval_dataset, processing_class=tokenizer,)
# ============ Train ============print("Starting training...")train_result = trainer.train()
# ============ Save Final Model ============print("Saving final model...")trainer.save_model(OUTPUT_DIR)tokenizer.save_pretrained(OUTPUT_DIR)
# Push to Hubprint("Pushing to Hub...")trainer.push_to_hub(commit_message="Final IndexLM-0.6B model")
# ============ Log Final Metrics ============metrics = train_result.metricsprint(f"\nTraining complete!")print(f" Train loss: {metrics.get('train_loss', 'N/A')}")print(f" Train runtime: {metrics.get('train_runtime', 'N/A'):.0f}s")print(f" Train samples/sec: {metrics.get('train_samples_per_second', 'N/A'):.1f}")
# Final evaleval_metrics = trainer.evaluate()print(f" Eval loss: {eval_metrics.get('eval_loss', 'N/A')}")
print(f"\nModel pushed to: https://huggingface.co/{HUB_MODEL_ID}")train_indexlm.pyAdded+137