Run this model with HF Jobs
Run cometadata/reference-segmentation-qwen3-4b 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/cometadata/reference-segmentation-qwen3-4b. 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/cometadata/reference-segmentation-qwen3-4b 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/cometadata/reference-segmentation-qwen3-4b. 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/cometadata/reference-segmentation-qwen3-4b. 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 cometadata/reference-segmentation-qwen3-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cometadata/reference-segmentation-qwen3-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cometadata/reference-segmentation-qwen3-4b") 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("cometadata/reference-segmentation-qwen3-4b") model = AutoModelForCausalLM.from_pretrained("cometadata/reference-segmentation-qwen3-4b", 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]:])) - COMET
How to use cometadata/reference-segmentation-qwen3-4b with COMET:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cometadata/reference-segmentation-qwen3-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cometadata/reference-segmentation-qwen3-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cometadata/reference-segmentation-qwen3-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cometadata/reference-segmentation-qwen3-4b
- SGLang
How to use cometadata/reference-segmentation-qwen3-4b 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 "cometadata/reference-segmentation-qwen3-4b" \ --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": "cometadata/reference-segmentation-qwen3-4b", "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 "cometadata/reference-segmentation-qwen3-4b" \ --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": "cometadata/reference-segmentation-qwen3-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cometadata/reference-segmentation-qwen3-4b with Docker Model Runner:
docker model run hf.co/cometadata/reference-segmentation-qwen3-4b
COMET Multilingual Reference Segmenter โ Qwen3-4B
Fine-tuned Qwen/Qwen3-4B (LoRA r=32, alpha=64 merged into root weights, non-thinking mode enable_thinking=False) for locating and segmenting bibliographic reference lists from PyMuPDF visual text blocks across multilingual academic PDFs.
Task & Format
Given numbered text blocks [0] ..., [1] ... from the back 65% of an academic article (in any language), the model outputs compact JSON:
{"start": 42, "end": 108, "ref_starts": [42, 44, 45, 47]}
start/end: inclusive block range of the bibliographic references (excluding section headers, trailing author biographies, funding/ethics statements, appendices, or author guidelines).ref_starts: sorted list of block indices where each individual reference begins (merging consecutive wrapped/multi-column blocks between tworef_startsinto a single verbatim reference string, and skipping running headers/page numbers).
Training & Evaluation
- Training data: 1,060
certain-validated multilingual OJS academic PDFs across ~700 journals, labeled withgemini-4-hydrogen. - Held-out eval: 131
certain-validated PDFs from strictly unseen OJS journals (batch_0002, stratified across regex-missed and regex-hit articles).
| Metric (Held-Out Unseen Journals, N=131) | Zero-Shot Qwen3-4B |
Fine-Tuned Qwen3-4B |
|---|---|---|
| Valid JSON | 97.71% | 100.0% |
| Reference Presence F1 | 0.9593 | 1.0000 |
Mean Span IoU ([start, end]) |
0.8050 | 0.9841 |
Mean Exact ref_starts Boundary F1 |
0.7316 | 0.9719 |
- Downloads last month
- 251