Intel/orca_dpo_pairs
Viewer • Updated • 12.9k • 1.9k • 321
How to use M4-ai/NeuralReyna-Mini-1.8B-v0.2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="M4-ai/NeuralReyna-Mini-1.8B-v0.2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("M4-ai/NeuralReyna-Mini-1.8B-v0.2")
model = AutoModelForCausalLM.from_pretrained("M4-ai/NeuralReyna-Mini-1.8B-v0.2")
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]:]))How to use M4-ai/NeuralReyna-Mini-1.8B-v0.2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "M4-ai/NeuralReyna-Mini-1.8B-v0.2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "M4-ai/NeuralReyna-Mini-1.8B-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/M4-ai/NeuralReyna-Mini-1.8B-v0.2
How to use M4-ai/NeuralReyna-Mini-1.8B-v0.2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "M4-ai/NeuralReyna-Mini-1.8B-v0.2" \
--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": "M4-ai/NeuralReyna-Mini-1.8B-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "M4-ai/NeuralReyna-Mini-1.8B-v0.2" \
--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": "M4-ai/NeuralReyna-Mini-1.8B-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use M4-ai/NeuralReyna-Mini-1.8B-v0.2 with Docker Model Runner:
docker model run hf.co/M4-ai/NeuralReyna-Mini-1.8B-v0.2
Taken aloobun/Reyna-Mini-1.8B-v0.2 and further fine-tuned it using DPO using the Intel/orca_dpo_pairs dataset.
This model has capabilities in coding, math, science, roleplay, and function calling.
This model was trained on OpenAI's ChatML prompt format.
GPT4ALL:
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | |
|---|---|---|---|---|---|---|---|
| arc_challenge | 1 | none | 0 | acc | 0.3208 | ± | 0.0136 |
| none | 0 | acc_norm | 0.3336 | ± | 0.0138 | ||
| arc_easy | 1 | none | 0 | acc | 0.6035 | ± | 0.0100 |
| none | 0 | acc_norm | 0.5833 | ± | 0.0101 | ||
| boolq | 2 | none | 0 | acc | 0.6526 | ± | 0.0083 |
| hellaswag | 1 | none | 0 | acc | 0.4556 | ± | 0.0050 |
| none | 0 | acc_norm | 0.6076 | ± | 0.0049 | ||
| openbookqa | 1 | none | 0 | acc | 0.2600 | ± | 0.0196 |
| none | 0 | acc_norm | 0.3460 | ± | 0.0213 | ||
| piqa | 1 | none | 0 | acc | 0.7236 | ± | 0.0104 |
| none | 0 | acc_norm | 0.7307 | ± | 0.0104 | ||
| winogrande | 1 | none | 0 | acc | 0.6062 | ± | 0.0137 |
This model may have overfitted to the DPO training data, and may not perform well.
Thanks to @aloobun and @Locutusque for their contributions to this model.
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 44.85 |
| AI2 Reasoning Challenge (25-Shot) | 37.80 |
| HellaSwag (10-Shot) | 60.51 |
| MMLU (5-Shot) | 45.04 |
| TruthfulQA (0-shot) | 37.75 |
| Winogrande (5-shot) | 60.93 |
| GSM8k (5-shot) | 27.07 |