Text Generation
Transformers
Safetensors
English
phi
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use Amu/dpo-phi2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Amu/dpo-phi2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Amu/dpo-phi2", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Amu/dpo-phi2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Amu/dpo-phi2", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Amu/dpo-phi2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Amu/dpo-phi2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Amu/dpo-phi2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Amu/dpo-phi2
- SGLang
How to use Amu/dpo-phi2 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 "Amu/dpo-phi2" \ --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": "Amu/dpo-phi2", "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 "Amu/dpo-phi2" \ --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": "Amu/dpo-phi2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Amu/dpo-phi2 with Docker Model Runner:
docker model run hf.co/Amu/dpo-phi2
Adding Evaluation Results
#1
by leaderboard-pr-bot - opened
README.md
CHANGED
|
@@ -1,7 +1,110 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
dpo-phi2 is an instruction-tuned model from microsoft/phi-2. Direct preference optimization (DPO) is used for fine-tuning on argilla/distilabel-intel-orca-dpo-pairs dataset.
|
|
@@ -20,4 +123,17 @@ dpo-phi2 is an instruction-tuned model from microsoft/phi-2. Direct preference o
|
|
| 20 |
|
| 21 |
* Toxicity: Despite being trained with carefully selected data, the model can still produce harmful content if explicitly prompted or instructed to do so. We chose to release the model for research purposes only -- We hope to help the open-source community develop the most effective ways to reduce the toxicity of a model directly after pretraining.
|
| 22 |
|
| 23 |
-
* Verbosity: Phi-2 being a base model often produces irrelevant or extra text and responses following its first answer to user prompts within a single turn. This is due to its training dataset being primarily textbooks, which results in textbook-like responses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
model-index:
|
| 6 |
+
- name: dpo-phi2
|
| 7 |
+
results:
|
| 8 |
+
- task:
|
| 9 |
+
type: text-generation
|
| 10 |
+
name: Text Generation
|
| 11 |
+
dataset:
|
| 12 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
| 13 |
+
type: ai2_arc
|
| 14 |
+
config: ARC-Challenge
|
| 15 |
+
split: test
|
| 16 |
+
args:
|
| 17 |
+
num_few_shot: 25
|
| 18 |
+
metrics:
|
| 19 |
+
- type: acc_norm
|
| 20 |
+
value: 61.69
|
| 21 |
+
name: normalized accuracy
|
| 22 |
+
source:
|
| 23 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 24 |
+
name: Open LLM Leaderboard
|
| 25 |
+
- task:
|
| 26 |
+
type: text-generation
|
| 27 |
+
name: Text Generation
|
| 28 |
+
dataset:
|
| 29 |
+
name: HellaSwag (10-Shot)
|
| 30 |
+
type: hellaswag
|
| 31 |
+
split: validation
|
| 32 |
+
args:
|
| 33 |
+
num_few_shot: 10
|
| 34 |
+
metrics:
|
| 35 |
+
- type: acc_norm
|
| 36 |
+
value: 75.13
|
| 37 |
+
name: normalized accuracy
|
| 38 |
+
source:
|
| 39 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 40 |
+
name: Open LLM Leaderboard
|
| 41 |
+
- task:
|
| 42 |
+
type: text-generation
|
| 43 |
+
name: Text Generation
|
| 44 |
+
dataset:
|
| 45 |
+
name: MMLU (5-Shot)
|
| 46 |
+
type: cais/mmlu
|
| 47 |
+
config: all
|
| 48 |
+
split: test
|
| 49 |
+
args:
|
| 50 |
+
num_few_shot: 5
|
| 51 |
+
metrics:
|
| 52 |
+
- type: acc
|
| 53 |
+
value: 58.1
|
| 54 |
+
name: accuracy
|
| 55 |
+
source:
|
| 56 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 57 |
+
name: Open LLM Leaderboard
|
| 58 |
+
- task:
|
| 59 |
+
type: text-generation
|
| 60 |
+
name: Text Generation
|
| 61 |
+
dataset:
|
| 62 |
+
name: TruthfulQA (0-shot)
|
| 63 |
+
type: truthful_qa
|
| 64 |
+
config: multiple_choice
|
| 65 |
+
split: validation
|
| 66 |
+
args:
|
| 67 |
+
num_few_shot: 0
|
| 68 |
+
metrics:
|
| 69 |
+
- type: mc2
|
| 70 |
+
value: 43.99
|
| 71 |
+
source:
|
| 72 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 73 |
+
name: Open LLM Leaderboard
|
| 74 |
+
- task:
|
| 75 |
+
type: text-generation
|
| 76 |
+
name: Text Generation
|
| 77 |
+
dataset:
|
| 78 |
+
name: Winogrande (5-shot)
|
| 79 |
+
type: winogrande
|
| 80 |
+
config: winogrande_xl
|
| 81 |
+
split: validation
|
| 82 |
+
args:
|
| 83 |
+
num_few_shot: 5
|
| 84 |
+
metrics:
|
| 85 |
+
- type: acc
|
| 86 |
+
value: 74.19
|
| 87 |
+
name: accuracy
|
| 88 |
+
source:
|
| 89 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 90 |
+
name: Open LLM Leaderboard
|
| 91 |
+
- task:
|
| 92 |
+
type: text-generation
|
| 93 |
+
name: Text Generation
|
| 94 |
+
dataset:
|
| 95 |
+
name: GSM8k (5-shot)
|
| 96 |
+
type: gsm8k
|
| 97 |
+
config: main
|
| 98 |
+
split: test
|
| 99 |
+
args:
|
| 100 |
+
num_few_shot: 5
|
| 101 |
+
metrics:
|
| 102 |
+
- type: acc
|
| 103 |
+
value: 54.44
|
| 104 |
+
name: accuracy
|
| 105 |
+
source:
|
| 106 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=amu/dpo-phi2
|
| 107 |
+
name: Open LLM Leaderboard
|
| 108 |
---
|
| 109 |
|
| 110 |
dpo-phi2 is an instruction-tuned model from microsoft/phi-2. Direct preference optimization (DPO) is used for fine-tuning on argilla/distilabel-intel-orca-dpo-pairs dataset.
|
|
|
|
| 123 |
|
| 124 |
* Toxicity: Despite being trained with carefully selected data, the model can still produce harmful content if explicitly prompted or instructed to do so. We chose to release the model for research purposes only -- We hope to help the open-source community develop the most effective ways to reduce the toxicity of a model directly after pretraining.
|
| 125 |
|
| 126 |
+
* Verbosity: Phi-2 being a base model often produces irrelevant or extra text and responses following its first answer to user prompts within a single turn. This is due to its training dataset being primarily textbooks, which results in textbook-like responses.
|
| 127 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 128 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_amu__dpo-phi2)
|
| 129 |
+
|
| 130 |
+
| Metric |Value|
|
| 131 |
+
|---------------------------------|----:|
|
| 132 |
+
|Avg. |61.26|
|
| 133 |
+
|AI2 Reasoning Challenge (25-Shot)|61.69|
|
| 134 |
+
|HellaSwag (10-Shot) |75.13|
|
| 135 |
+
|MMLU (5-Shot) |58.10|
|
| 136 |
+
|TruthfulQA (0-shot) |43.99|
|
| 137 |
+
|Winogrande (5-shot) |74.19|
|
| 138 |
+
|GSM8k (5-shot) |54.44|
|
| 139 |
+
|