Text Generation
Transformers
Safetensors
English
clarification
ambiguity-detection
question-answering
qwen2.5
grpo
reinforcement-learning
conversational
Instructions to use chrisjcc/ask-before-answer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chrisjcc/ask-before-answer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chrisjcc/ask-before-answer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("chrisjcc/ask-before-answer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chrisjcc/ask-before-answer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chrisjcc/ask-before-answer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chrisjcc/ask-before-answer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chrisjcc/ask-before-answer
- SGLang
How to use chrisjcc/ask-before-answer 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 "chrisjcc/ask-before-answer" \ --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": "chrisjcc/ask-before-answer", "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 "chrisjcc/ask-before-answer" \ --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": "chrisjcc/ask-before-answer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chrisjcc/ask-before-answer with Docker Model Runner:
docker model run hf.co/chrisjcc/ask-before-answer
Upload folder using huggingface_hub
Browse files- README.md +27 -7
- adapter_config.json +4 -4
- adapter_model.safetensors +1 -1
- training_args.bin +2 -2
README.md
CHANGED
|
@@ -13,7 +13,7 @@ tags:
|
|
| 13 |
- ambiguity-detection
|
| 14 |
- question-answering
|
| 15 |
- qwen2.5
|
| 16 |
-
-
|
| 17 |
- reinforcement-learning
|
| 18 |
---
|
| 19 |
|
|
@@ -31,12 +31,12 @@ the missing information and ask a targeted clarification question.
|
|
| 31 |
This repository contains the exact W&B artifact approved by the project's
|
| 32 |
model promotion procedure.
|
| 33 |
|
| 34 |
-
- **Training method:**
|
| 35 |
-
- **Model variant:** `
|
| 36 |
- **W&B Registry alias at promotion:** `production`
|
| 37 |
-
- **W&B artifact:** `wandb-registry-Model/AskBeforeAnswer-
|
| 38 |
-
- **W&B artifact digest:** `
|
| 39 |
-
- **Release:** `v0.
|
| 40 |
- **Base model:** `Qwen/Qwen2.5-7B-Instruct`
|
| 41 |
- **Dataset:** `chrisjcc/ask-before-answer-dataset`
|
| 42 |
|
|
@@ -80,7 +80,27 @@ the promotion record.
|
|
| 80 |
|
| 81 |
Evaluation
|
| 82 |
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
## Usage
|
| 86 |
```
|
|
|
|
| 13 |
- ambiguity-detection
|
| 14 |
- question-answering
|
| 15 |
- qwen2.5
|
| 16 |
+
- dpo
|
| 17 |
- reinforcement-learning
|
| 18 |
---
|
| 19 |
|
|
|
|
| 31 |
This repository contains the exact W&B artifact approved by the project's
|
| 32 |
model promotion procedure.
|
| 33 |
|
| 34 |
+
- **Training method:** Direct Preference Optimization (DPO)
|
| 35 |
+
- **Model variant:** `dpo`
|
| 36 |
- **W&B Registry alias at promotion:** `production`
|
| 37 |
+
- **W&B artifact:** `wandb-registry-Model/AskBeforeAnswer-dpo:v0`
|
| 38 |
+
- **W&B artifact digest:** `51fadb59065e11213173e689bd606b0f`
|
| 39 |
+
- **Release:** `v0.2.0`
|
| 40 |
- **Base model:** `Qwen/Qwen2.5-7B-Instruct`
|
| 41 |
- **Dataset:** `chrisjcc/ask-before-answer-dataset`
|
| 42 |
|
|
|
|
| 80 |
|
| 81 |
Evaluation
|
| 82 |
|
| 83 |
+
## LLM-as-a-Judge Evaluation Leaderboard
|
| 84 |
+
|
| 85 |
+
The following scores were computed using W&B Weave with a
|
| 86 |
+
Gemini-based judge scorer on a randomly selected
|
| 87 |
+
**50-sample** subset
|
| 88 |
+
of the `sewon/ambig_qa` (validation split).
|
| 89 |
+
|
| 90 |
+
| Metric | base | dpo_only | sft | sft_dpo | clarifier_lora | orpo | grpo |
|
| 91 |
+
|:----------------------|----------:|-----------:|---------:|----------:|-----------------:|---------:|---------:|
|
| 92 |
+
| ambiguity_detection | 0.966 | 0.974 | 0.97 | 0.946 | 0.994 | 0.968 | 0.952 |
|
| 93 |
+
| clarification_quality | 0.784 | 0.79 | 0.794 | 0.778 | 0.796 | 0.796 | 0.792 |
|
| 94 |
+
| usefulness | 0.88 | 0.882 | 0.896 | 0.878 | 0.896 | 0.896 | 0.894 |
|
| 95 |
+
| model_accuracy | 0.62 | 0.62 | 0.6 | 0.62 | 0.6 | 0.64 | 0.62 |
|
| 96 |
+
| clarify_precision | 0.617021 | 0.617021 | 0.631579 | 0.657143 | 0.6 | 0.636364 | 0.634146 |
|
| 97 |
+
| clarify_recall | 0.966667 | 0.966667 | 0.8 | 0.766667 | 1 | 0.933333 | 0.866667 |
|
| 98 |
+
| clarify_f1 | 0.753247 | 0.753247 | 0.705882 | 0.707692 | 0.75 | 0.756757 | 0.732394 |
|
| 99 |
+
| action_f1_answer | 0.173913 | 0.173913 | 0.375 | 0.457143 | 0 | 0.307692 | 0.344828 |
|
| 100 |
+
| macro_f1 | 0.46358 | 0.46358 | 0.540441 | 0.582418 | 0.375 | 0.532225 | 0.538611 |
|
| 101 |
+
| answer_accuracy | 0.05 | 0.05 | 0 | 0 | 0 | 0.1 | 0.1 |
|
| 102 |
+
| facet_generation_rate | 0.0851064 | 0.234043 | 1 | 1 | 0 | 0.977273 | 1 |
|
| 103 |
+
| clarify_ratio | 1.56667 | 1.56667 | 1.26667 | 1.16667 | 1.66667 | 1.46667 | 1.36667 |
|
| 104 |
|
| 105 |
## Usage
|
| 106 |
```
|
adapter_config.json
CHANGED
|
@@ -35,13 +35,13 @@
|
|
| 35 |
"rank_pattern": {},
|
| 36 |
"revision": null,
|
| 37 |
"target_modules": [
|
| 38 |
-
"q_proj",
|
| 39 |
-
"down_proj",
|
| 40 |
"gate_proj",
|
| 41 |
-
"
|
| 42 |
"o_proj",
|
|
|
|
| 43 |
"v_proj",
|
| 44 |
-
"
|
|
|
|
| 45 |
],
|
| 46 |
"target_parameters": null,
|
| 47 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 35 |
"rank_pattern": {},
|
| 36 |
"revision": null,
|
| 37 |
"target_modules": [
|
|
|
|
|
|
|
| 38 |
"gate_proj",
|
| 39 |
+
"up_proj",
|
| 40 |
"o_proj",
|
| 41 |
+
"down_proj",
|
| 42 |
"v_proj",
|
| 43 |
+
"q_proj",
|
| 44 |
+
"k_proj"
|
| 45 |
],
|
| 46 |
"target_parameters": null,
|
| 47 |
"task_type": "CAUSAL_LM",
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 161533192
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6ff988941d4722799874703b10d7938908ad0304e61b8da8b0cc265d1bfece2b
|
| 3 |
size 161533192
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c131f5192230a49a82dd678ab22fe1f78e9d22d4f73185693c6c49559b73fe52
|
| 3 |
+
size 6584
|