Update README.md
Browse files
README.md
CHANGED
|
@@ -20,3 +20,45 @@ base_model:
|
|
| 20 |
## Model Details
|
| 21 |
Deepseek-R1のDistill手法を模倣した、open-r1を採用して、phi-4モデルを Reasonerにしたモデルです。
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
## Model Details
|
| 21 |
Deepseek-R1のDistill手法を模倣した、open-r1を採用して、phi-4モデルを Reasonerにしたモデルです。
|
| 22 |
|
| 23 |
+
## HOW TO USE
|
| 24 |
+
### Setup
|
| 25 |
+
```
|
| 26 |
+
pip install --upgrade transformers accelerate datasets trl
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
### Predict(using AutoModelForCausalLM)
|
| 30 |
+
```python
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Predict(using vllm)
|
| 35 |
+
#### Setup
|
| 36 |
+
```
|
| 37 |
+
pip install vllm
|
| 38 |
+
vllm serve AXCXEPT/phi-4-open-R1-Distill-EZOv1
|
| 39 |
+
```
|
| 40 |
+
#### Predict
|
| 41 |
+
```
|
| 42 |
+
from openai import OpenAI
|
| 43 |
+
client = OpenAI(
|
| 44 |
+
base_url="http://localhost:8000/v1",
|
| 45 |
+
api_key="token-abc123",
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
prompt = f"""
|
| 49 |
+
There is a question concerning the age of a father and his child. The conditions are as follows
|
| 50 |
+
|
| 51 |
+
The father's current age is 3 times the son's current age.
|
| 52 |
+
Six years ago, the father's age was five times the son's age.
|
| 53 |
+
Find the ages of the father and the son.
|
| 54 |
+
"""
|
| 55 |
+
completion = client.chat.completions.create(
|
| 56 |
+
model="AXCXEPT/EZO-phi-4-openr1-v1_917",
|
| 57 |
+
messages=[
|
| 58 |
+
{"role": "system", "content": "You are an excellent AI. Please answer carefully and thoughtfully, in the same language as the instructions."}
|
| 59 |
+
{"role": "user", "content": prompt}
|
| 60 |
+
]
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
print(completion.choices[0].message.content)
|
| 64 |
+
```
|