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
CHANGED
|
@@ -27,7 +27,7 @@ The **AskBeforeAnswer** model exhibits "clarification-seeking" behavior. When pr
|
|
| 27 |
- **Stage 1 (SFT):** Aligned to output structured JSON indicating `Action: Clarify` or `Action: Answer`.
|
| 28 |
- **Stage 2 (DPO):** Preference optimized to strongly penalize hallucinations on ambiguous queries, using `chrisjcc/ask-before-answer-data`.
|
| 29 |
|
| 30 |
-
**GitHub Release:** [v0.0.
|
| 31 |
|
| 32 |
## Usage
|
| 33 |
```python
|
|
|
|
| 27 |
- **Stage 1 (SFT):** Aligned to output structured JSON indicating `Action: Clarify` or `Action: Answer`.
|
| 28 |
- **Stage 2 (DPO):** Preference optimized to strongly penalize hallucinations on ambiguous queries, using `chrisjcc/ask-before-answer-data`.
|
| 29 |
|
| 30 |
+
**GitHub Release:** [v0.0.4](https://github.com/chrisjcc/ask-before-answer/releases/tag/v0.0.4)
|
| 31 |
|
| 32 |
## Usage
|
| 33 |
```python
|