Instructions to use bardsai/jaskier-7b-dpo-v6.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bardsai/jaskier-7b-dpo-v6.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bardsai/jaskier-7b-dpo-v6.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bardsai/jaskier-7b-dpo-v6.1") model = AutoModelForCausalLM.from_pretrained("bardsai/jaskier-7b-dpo-v6.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bardsai/jaskier-7b-dpo-v6.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bardsai/jaskier-7b-dpo-v6.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bardsai/jaskier-7b-dpo-v6.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bardsai/jaskier-7b-dpo-v6.1
- SGLang
How to use bardsai/jaskier-7b-dpo-v6.1 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 "bardsai/jaskier-7b-dpo-v6.1" \ --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": "bardsai/jaskier-7b-dpo-v6.1", "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 "bardsai/jaskier-7b-dpo-v6.1" \ --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": "bardsai/jaskier-7b-dpo-v6.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bardsai/jaskier-7b-dpo-v6.1 with Docker Model Runner:
docker model run hf.co/bardsai/jaskier-7b-dpo-v6.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,38 +20,21 @@ Model based on `bardsai/jaskier-7b-dpo-v5.6` (downstream version of Mistral7B) f
|
|
| 20 |
|
| 21 |
You can use this model directly with a Hugging Face pipeline:
|
| 22 |
```python
|
| 23 |
-
import ...
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
messages = [{'messages':[{
|
| 28 |
-
"role": "user",
|
| 29 |
-
"content": "How much is 2+2"
|
| 30 |
-
}]},
|
| 31 |
-
{'messages':[{
|
| 32 |
-
"role": "user",
|
| 33 |
-
"content": "Tell me where the nearest water park is?"
|
| 34 |
-
}]},
|
| 35 |
-
]
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
"do_sample": True,
|
| 43 |
-
"temperature": 0.7,
|
| 44 |
-
"max_new_tokens": 1024,
|
| 45 |
-
}
|
| 46 |
-
model_outputs = [out[-1]['content'] for out in p(conversations(), **generate_kwargs)]
|
| 47 |
-
|
| 48 |
-
print(model_outputs)
|
| 49 |
|
| 50 |
```
|
| 51 |
|
| 52 |
## Output
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
## Changelog
|
| 57 |
|
|
|
|
| 20 |
|
| 21 |
You can use this model directly with a Hugging Face pipeline:
|
| 22 |
```python
|
|
|
|
| 23 |
|
| 24 |
+
from transformers import pipeline, Conversation
|
| 25 |
+
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
base_model_name = "bardsai/jaskier-7b-dpo-v6.1"
|
| 28 |
+
chatbot = pipeline("conversational", model=base_model_name, torch_dtype=torch.float16, device_map="auto")
|
| 29 |
+
conversation = Conversation("Can Poland into space?")
|
| 30 |
+
conversation = chatbot(conversation)
|
| 31 |
+
print(conversation.messages[-1]["content"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
```
|
| 34 |
|
| 35 |
## Output
|
| 36 |
|
| 37 |
+
"Poland, as a nation, doesn't physically travel to space. However, Poland has contributed to the field of space exploration through its scientists, engineers, and collaborations with international space agencies. The Polish Space Agency, established in 2016, aims to promote and coordinate the country's space activities."
|
| 38 |
|
| 39 |
## Changelog
|
| 40 |
|