Update introduction and examples
Browse files
README.md
CHANGED
@@ -12,7 +12,8 @@ tags:
|
|
12 |
|
13 |
## Model Summary
|
14 |
|
15 |
-
This repo provides the GGUF format for the Phi-3-Mini-4K-Instruct.
|
|
|
16 |
The model belongs to the Phi-3 family with the Mini version in two variants [4K](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) and [128K](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct) which is the context length (in tokens) it can support.
|
17 |
The model has underwent a post-training process that incorporates both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
18 |
When assessed against benchmarks testing common sense, language understanding, math, code, long context and logical reasoning, Phi-3 Mini-4K-Instruct showcased a robust and state-of-the-art performance among models with less than 13 billion parameters.
|
@@ -53,12 +54,15 @@ Nothing contained in this Model Card should be interpreted as or deemed a restri
|
|
53 |
|
54 |
## Chat Format:
|
55 |
|
56 |
-
Given the nature of the training data, the Phi-3-Mini-4K-instruct model is best suited for prompts using the chat format as follows.
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
```markdown
|
59 |
<|user|>
|
60 |
-
How to explain Internet for a medieval knight
|
61 |
-
<|end|>
|
62 |
<|assistant|>
|
63 |
```
|
64 |
|
@@ -66,13 +70,11 @@ where the model generates the text after "<|assistant|>" . In case of few-shots
|
|
66 |
|
67 |
```markdown
|
68 |
<|user|>
|
69 |
-
I am going to Paris, what should I see
|
70 |
-
<|end|>
|
71 |
<|assistant|>
|
72 |
-
Paris, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:\n\n1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.\n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.\n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.\n\nThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world."
|
73 |
-
<|end|>
|
74 |
<|user|>
|
75 |
-
What is so great about #1
|
76 |
<|assistant|>
|
77 |
```
|
78 |
|
@@ -129,7 +131,7 @@ Replace "Your prompt here" with the actual prompt you want to use for generating
|
|
129 |
|
130 |
## How to use with Llamafile:
|
131 |
|
132 |
-
|
133 |
|
134 |
1. **Download Llamafile-0.7.3**
|
135 |
```
|
@@ -180,7 +182,7 @@ prompt = "How to explain Internet to a medieval knight?"
|
|
180 |
|
181 |
# Simple inference example
|
182 |
output = llm(
|
183 |
-
f"<|user|>\n{prompt}
|
184 |
max_tokens=256, # Generate up to 256 tokens
|
185 |
stop=["<|end|>"],
|
186 |
echo=True, # Whether to echo the prompt
|
|
|
12 |
|
13 |
## Model Summary
|
14 |
|
15 |
+
This repo provides the GGUF format for the Phi-3-Mini-4K-Instruct.
|
16 |
+
The Phi-3-Mini-4K-Instruct is a 3.8B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes both synthetic data and the filtered publicly available websites data with a focus on high-quality and reasoning dense properties.
|
17 |
The model belongs to the Phi-3 family with the Mini version in two variants [4K](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) and [128K](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct) which is the context length (in tokens) it can support.
|
18 |
The model has underwent a post-training process that incorporates both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
|
19 |
When assessed against benchmarks testing common sense, language understanding, math, code, long context and logical reasoning, Phi-3 Mini-4K-Instruct showcased a robust and state-of-the-art performance among models with less than 13 billion parameters.
|
|
|
54 |
|
55 |
## Chat Format:
|
56 |
|
57 |
+
Given the nature of the training data, the Phi-3-Mini-4K-instruct model is best suited for prompts using the chat format as follows.
|
58 |
+
You can provide the prompt as a question with a generic template as follow:
|
59 |
+
```markdown
|
60 |
+
<|user|>\nQuestion <|end|>\n<|assistant|>
|
61 |
+
```
|
62 |
+
For example:
|
63 |
```markdown
|
64 |
<|user|>
|
65 |
+
How to explain Internet for a medieval knight?<|end|>
|
|
|
66 |
<|assistant|>
|
67 |
```
|
68 |
|
|
|
70 |
|
71 |
```markdown
|
72 |
<|user|>
|
73 |
+
I am going to Paris, what should I see?<|end|>
|
|
|
74 |
<|assistant|>
|
75 |
+
Paris, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:\n\n1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.\n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.\n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.\n\nThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world."<|end|>
|
|
|
76 |
<|user|>
|
77 |
+
What is so great about #1?<|end|>
|
78 |
<|assistant|>
|
79 |
```
|
80 |
|
|
|
131 |
|
132 |
## How to use with Llamafile:
|
133 |
|
134 |
+
Assuming that you already have GGUF files downloaded. Here is how you can use the GGUF model with [Llamafile](https://github.com/Mozilla-Ocho/llamafile):
|
135 |
|
136 |
1. **Download Llamafile-0.7.3**
|
137 |
```
|
|
|
182 |
|
183 |
# Simple inference example
|
184 |
output = llm(
|
185 |
+
f"<|user|>\n{prompt}<|end|>\n<|assistant|>",
|
186 |
max_tokens=256, # Generate up to 256 tokens
|
187 |
stop=["<|end|>"],
|
188 |
echo=True, # Whether to echo the prompt
|