Instructions to use kashif/DeepConf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kashif/DeepConf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kashif/DeepConf")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kashif/DeepConf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kashif/DeepConf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kashif/DeepConf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kashif/DeepConf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kashif/DeepConf
- SGLang
How to use kashif/DeepConf 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 "kashif/DeepConf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kashif/DeepConf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "kashif/DeepConf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kashif/DeepConf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kashif/DeepConf with Docker Model Runner:
docker model run hf.co/kashif/DeepConf
Update README.md
Browse files
README.md
CHANGED
|
@@ -53,8 +53,7 @@ outputs = model.generate(
|
|
| 53 |
|
| 54 |
DeepConf’s online stopping threshold is derived from a short warmup phase. You collect warmup trace confidences, then pass them into the generator to auto-derive the threshold for either DeepConf-low (aggressive) or DeepConf-high (permissive).
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
```python
|
| 59 |
from transformers import GenerationConfig
|
| 60 |
|
|
@@ -83,9 +82,7 @@ out = model.generate(
|
|
| 83 |
warmup_C = out.confidences.min(dim=1).values.tolist()
|
| 84 |
```
|
| 85 |
|
| 86 |
-
|
| 87 |
-
2) Online: pass warmup confidences to auto-derive threshold
|
| 88 |
-
|
| 89 |
```python
|
| 90 |
gen_cfg = GenerationConfig.from_model_config(model.config)
|
| 91 |
gen_cfg.enable_conf = True
|
|
|
|
| 53 |
|
| 54 |
DeepConf’s online stopping threshold is derived from a short warmup phase. You collect warmup trace confidences, then pass them into the generator to auto-derive the threshold for either DeepConf-low (aggressive) or DeepConf-high (permissive).
|
| 55 |
|
| 56 |
+
1. Warmup (num_return_sequences): collect per-trace confidences (C_t = min(step_confidences))
|
|
|
|
| 57 |
```python
|
| 58 |
from transformers import GenerationConfig
|
| 59 |
|
|
|
|
| 82 |
warmup_C = out.confidences.min(dim=1).values.tolist()
|
| 83 |
```
|
| 84 |
|
| 85 |
+
2. Online: pass warmup confidences to auto-derive threshold
|
|
|
|
|
|
|
| 86 |
```python
|
| 87 |
gen_cfg = GenerationConfig.from_model_config(model.config)
|
| 88 |
gen_cfg.enable_conf = True
|