Instructions to use krogoldAI/QueryRefiner-0.5B-v0.1-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use krogoldAI/QueryRefiner-0.5B-v0.1-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="krogoldAI/QueryRefiner-0.5B-v0.1-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("krogoldAI/QueryRefiner-0.5B-v0.1-GRPO") model = AutoModelForCausalLM.from_pretrained("krogoldAI/QueryRefiner-0.5B-v0.1-GRPO", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use krogoldAI/QueryRefiner-0.5B-v0.1-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/krogoldAI/QueryRefiner-0.5B-v0.1-GRPO
- SGLang
How to use krogoldAI/QueryRefiner-0.5B-v0.1-GRPO 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 "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO" \ --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": "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO", "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 "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO" \ --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": "krogoldAI/QueryRefiner-0.5B-v0.1-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use krogoldAI/QueryRefiner-0.5B-v0.1-GRPO with Docker Model Runner:
docker model run hf.co/krogoldAI/QueryRefiner-0.5B-v0.1-GRPO
Update README.md
Browse files
README.md
CHANGED
|
@@ -463,4 +463,18 @@ Performance characteristics will vary based on query type, domain, and ambiguity
|
|
| 463 |
|
| 464 |
## Acknowledgments
|
| 465 |
|
| 466 |
-
This model builds upon [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) by the Qwen team at Alibaba Cloud. The training data incorporates queries from [rag-datasets/rag-mini-wikipedia](https://huggingface.co/datasets/rag-datasets/rag-mini-wikipedia), [razbit96/Ambiguity-Handling-in-User-Queries](https://huggingface.co/datasets/razbit96/Ambiguity-Handling-in-User-Queries), and [glaiveai/RAG-v1](https://huggingface.co/datasets/glaiveai/RAG-v1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
|
| 464 |
## Acknowledgments
|
| 465 |
|
| 466 |
+
This model builds upon [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) by the Qwen team at Alibaba Cloud. The training data incorporates queries from [rag-datasets/rag-mini-wikipedia](https://huggingface.co/datasets/rag-datasets/rag-mini-wikipedia), [razbit96/Ambiguity-Handling-in-User-Queries](https://huggingface.co/datasets/razbit96/Ambiguity-Handling-in-User-Queries), and [glaiveai/RAG-v1](https://huggingface.co/datasets/glaiveai/RAG-v1).
|
| 467 |
+
|
| 468 |
+
---
|
| 469 |
+
|
| 470 |
+
#### A. Per-ambiguity breakdown + sample sizes
|
| 471 |
+
|
| 472 |
+
| | NONE | LOW | MEDIUM | HIGH |
|
| 473 |
+
|:---------------------|:---------------|:---------------|:---------------|:---------------|
|
| 474 |
+
| domain_accuracy | 98.82 ± 9.48% | 98.91 ± 8.53% | 99.26 ± 6.54% | 99.04 ± 4.85% |
|
| 475 |
+
| intent_accuracy | 98.77 ± 8.94% | 99.24 ± 6.93% | 98.77 ± 6.46% | 95.67 ± 10.76% |
|
| 476 |
+
| ambiguity_assessment | 99.27 ± 6.56% | 99.33 ± 6.46% | 99.63 ± 3.02% | 100.00 ± 0.00% |
|
| 477 |
+
| rephrasing_quality | 90.81 ± 17.49% | 89.98 ± 18.80% | 90.52 ± 15.11% | 87.50 ± 20.71% |
|
| 478 |
+
| intent_preservation | 96.13 ± 14.72% | 95.88 ± 15.71% | 96.80 ± 12.02% | 92.79 ± 18.08% |
|
| 479 |
+
| follows_guidelines | 97.14 ± 13.26% | 97.05 ± 12.91% | 98.89 ± 7.17% | 95.67 ± 13.76% |
|
| 480 |
+
| semantic_score | 96.82 ± 9.58% | 96.73 ± 9.80% | 97.31 ± 6.82% | 95.11 ± 10.06% |
|