Text Generation
Transformers
Safetensors
English
Japanese
phi3
conversational
custom_code
text-generation-inference
Instructions to use AXCXEPT/phi-4-open-R1-Distill-EZOv1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AXCXEPT/phi-4-open-R1-Distill-EZOv1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AXCXEPT/phi-4-open-R1-Distill-EZOv1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AXCXEPT/phi-4-open-R1-Distill-EZOv1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("AXCXEPT/phi-4-open-R1-Distill-EZOv1", trust_remote_code=True) 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AXCXEPT/phi-4-open-R1-Distill-EZOv1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AXCXEPT/phi-4-open-R1-Distill-EZOv1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AXCXEPT/phi-4-open-R1-Distill-EZOv1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AXCXEPT/phi-4-open-R1-Distill-EZOv1
- SGLang
How to use AXCXEPT/phi-4-open-R1-Distill-EZOv1 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 "AXCXEPT/phi-4-open-R1-Distill-EZOv1" \ --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": "AXCXEPT/phi-4-open-R1-Distill-EZOv1", "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 "AXCXEPT/phi-4-open-R1-Distill-EZOv1" \ --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": "AXCXEPT/phi-4-open-R1-Distill-EZOv1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AXCXEPT/phi-4-open-R1-Distill-EZOv1 with Docker Model Runner:
docker model run hf.co/AXCXEPT/phi-4-open-R1-Distill-EZOv1
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,7 +18,45 @@ base_model:
|
|
| 18 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 19 |
|
| 20 |
## Model Details
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
--------------------------------------
|
| 24 |
## HOW TO USE
|
|
|
|
| 18 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 19 |
|
| 20 |
## Model Details
|
| 21 |
+
This model is a Reasoner version of the phi-4 model by employing open-r1, which mimics the Distill methodology of Deepseek-R1.
|
| 22 |
+
(Deepseek-R1のDistill手法を模倣した、open-r1を採用して、phi-4モデルを Reasonerにしたモデルです)
|
| 23 |
+
|
| 24 |
+
## Example Output
|
| 25 |
+
```
|
| 26 |
+
<thinking>
|
| 27 |
+
まず、問題文を整理します。父親の現在の年齢は息子の3倍であり、6年前の父親の年齢は息子の5倍でした。これを数式で表現すると:
|
| 28 |
+
|
| 29 |
+
1. 現在の年齢関係:父親の年齢 = 3 × 息子の年齢 → F = 3S
|
| 30 |
+
2. 6年前の年齢関係:父親の年齢 - 6 = 5 × (息子の年齢 - 6) → F - 6 = 5(S - 6)
|
| 31 |
+
|
| 32 |
+
これらの2つの方程式を同時に解きます。まず第1式からF = 3Sを代入すると:
|
| 33 |
+
|
| 34 |
+
3S - 6 = 5(S - 6)
|
| 35 |
+
3S - 6 = 5S - 30
|
| 36 |
+
30 - 6 = 5S - 3S
|
| 37 |
+
24 = 2S
|
| 38 |
+
S = 12
|
| 39 |
+
|
| 40 |
+
息子の年齢が12歳であることが分かります。これを第1式に代入すると:
|
| 41 |
+
|
| 42 |
+
F = 3 × 12 = 36
|
| 43 |
+
|
| 44 |
+
父親の年齢は36歳です。最後に条件を確認します:
|
| 45 |
+
- 現在の年齢関係:36 = 3×12 → 成立
|
| 46 |
+
- 6年前の年齢関係:36-6=30 vs 12-6=6 → 30=5×6 → 成立
|
| 47 |
+
|
| 48 |
+
両方の条件が満たされているため、解は正しいと言えます。
|
| 49 |
+
</thinking>
|
| 50 |
+
|
| 51 |
+
<answer>
|
| 52 |
+
父親の年齢は36歳、息子の年齢は12歳です。
|
| 53 |
+
|
| 54 |
+
根拠:
|
| 55 |
+
1. 現在の年齢関係:36 = 3×12(成立)
|
| 56 |
+
2. 6年前の年齢関係:30 = 5×6(成立)
|
| 57 |
+
3. 両方の条件を満たす唯一の解
|
| 58 |
+
</answer>
|
| 59 |
+
```
|
| 60 |
|
| 61 |
--------------------------------------
|
| 62 |
## HOW TO USE
|