update readme
Browse files
README.md
CHANGED
|
@@ -18,13 +18,13 @@ library_name: transformers
|
|
| 18 |
|
| 19 |
Phi-4-mini-instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
|
| 20 |
|
| 21 |
-
🏡 [Phi-4-mini Portal]() <br>
|
| 22 |
📰 [Phi-4-mini Microsoft Blog](https://aka.ms/phi4techblog-feb2025) <br>
|
| 23 |
📖 [Phi-4-mini Technical Report]() <br>
|
| 24 |
👩🍳 [Phi-4-mini Cookbook]() <br>
|
| 25 |
🖥️ [Try It](https://aks.ms/try-phi4mini) <br>
|
| 26 |
|
| 27 |
-
**Phi-4-mini**: [[mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct) | [onnx]()]; [[multimodal-instruct]](https://huggingface.co/microsoft/Phi-4-multimodal-instruct);
|
| 28 |
|
| 29 |
## Intended Uses
|
| 30 |
|
|
@@ -173,14 +173,16 @@ import torch
|
|
| 173 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
| 174 |
|
| 175 |
torch.random.manual_seed(0)
|
| 176 |
-
|
|
|
|
|
|
|
| 177 |
model = AutoModelForCausalLM.from_pretrained(
|
| 178 |
-
|
| 179 |
-
device_map="
|
| 180 |
torch_dtype="auto",
|
| 181 |
trust_remote_code=True,
|
| 182 |
)
|
| 183 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 184 |
|
| 185 |
messages = [
|
| 186 |
{"role": "system", "content": "You are a helpful AI assistant."},
|
|
|
|
| 18 |
|
| 19 |
Phi-4-mini-instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
|
| 20 |
|
| 21 |
+
🏡 [Phi-4-mini Portal](https://azure.microsoft.com/en-us/products/phi) <br>
|
| 22 |
📰 [Phi-4-mini Microsoft Blog](https://aka.ms/phi4techblog-feb2025) <br>
|
| 23 |
📖 [Phi-4-mini Technical Report]() <br>
|
| 24 |
👩🍳 [Phi-4-mini Cookbook]() <br>
|
| 25 |
🖥️ [Try It](https://aks.ms/try-phi4mini) <br>
|
| 26 |
|
| 27 |
+
**Phi-4-mini**: [[mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct) | [onnx](https://huggingface.co/microsoft/Phi-4-mini-instruct-onnx)]; [[multimodal-instruct]](https://huggingface.co/microsoft/Phi-4-multimodal-instruct);
|
| 28 |
|
| 29 |
## Intended Uses
|
| 30 |
|
|
|
|
| 173 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
| 174 |
|
| 175 |
torch.random.manual_seed(0)
|
| 176 |
+
|
| 177 |
+
model_path = "microsoft/Phi-4-mini-instruct"
|
| 178 |
+
|
| 179 |
model = AutoModelForCausalLM.from_pretrained(
|
| 180 |
+
model_path,
|
| 181 |
+
device_map="auto",
|
| 182 |
torch_dtype="auto",
|
| 183 |
trust_remote_code=True,
|
| 184 |
)
|
| 185 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 186 |
|
| 187 |
messages = [
|
| 188 |
{"role": "system", "content": "You are a helpful AI assistant."},
|