Text Generation
Transformers
Safetensors
English
llama
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2") model = AutoModelForCausalLM.from_pretrained("kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2
- SGLang
How to use kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2 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 "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2" \ --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": "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2", "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 "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2" \ --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": "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2 with Docker Model Runner:
docker model run hf.co/kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2
Upload 2 files
Browse files- .gitattributes +1 -0
- README.md +54 -0
- sakura.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
sakura.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
datasets:
|
| 5 |
+
- kyujinpy/orca_math_dpo
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
license: cc-by-nc-sa-4.0
|
| 8 |
---
|
| 9 |
+
|
| 10 |
+
# **Sakura-SOLRCA-Math-Instruct-DPO-v2**
|
| 11 |
+
<img src='./sakura.png' width=512>
|
| 12 |
+
|
| 13 |
+
## Model Details
|
| 14 |
+
|
| 15 |
+
**Model Developers** Kyujin Han (kyujinpy)
|
| 16 |
+
|
| 17 |
+
**Method**
|
| 18 |
+
Using DPO method.
|
| 19 |
+
With [Intel/orca_dpo_pairs](https://huggingface.co/datasets/Intel/orca_dpo_pairs) and [argilla/distilabel-math-preference-dpo](https://huggingface.co/datasets/argilla/distilabel-math-preference-dpo).
|
| 20 |
+
|
| 21 |
+
I shared the merge version [kyujinpy/orca_math_dpo](https://huggingface.co/datasets/kyujinpy/orca_math_dpo).
|
| 22 |
+
|
| 23 |
+
I will share the information about my model. (training and code)
|
| 24 |
+
Please see: ⭐[Sakura-SOLAR(will update)]().
|
| 25 |
+
|
| 26 |
+
# **Model Benchmark**
|
| 27 |
+
|
| 28 |
+
## Open leaderboard
|
| 29 |
+
- Follow up as [link](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
| 30 |
+
|
| 31 |
+
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K |
|
| 32 |
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
| 33 |
+
| Sakura-SOLRCA-Math-Instruct-DPO-v2 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 34 |
+
| Sakura-SOLRCA-Math-Instruct-DPO-v1 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 35 |
+
| Sakura-SOLRCA-Instruct-DPO | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 36 |
+
| Sakura-SOLAR-Instruct-DPO-v2 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 37 |
+
| Sakura-SOLAR-Instruct-DPO-v1 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 38 |
+
| [kyujinpy/Sakura-SOLAR-Instruct](https://huggingface.co/kyujinpy/Sakura-SOLAR-Instruct) | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
# Implementation Code
|
| 42 |
+
```python
|
| 43 |
+
### KO-Platypus
|
| 44 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 45 |
+
import torch
|
| 46 |
+
|
| 47 |
+
repo = "kyujinpy/Sakura-SOLRCA-Math-Instruct-DPO-v2"
|
| 48 |
+
OpenOrca = AutoModelForCausalLM.from_pretrained(
|
| 49 |
+
repo,
|
| 50 |
+
return_dict=True,
|
| 51 |
+
torch_dtype=torch.float16,
|
| 52 |
+
device_map='auto'
|
| 53 |
+
)
|
| 54 |
+
OpenOrca_tokenizer = AutoTokenizer.from_pretrained(repo)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
---
|
sakura.png
ADDED
|
Git LFS Details
|