garg-amit commited on
Commit
46fb142
1 Parent(s): aa13f6c

upload model card

Browse files
Files changed (4) hide show
  1. README.md +265 -3
  2. config.json +1 -1
  3. configuration_phimoe.py +3 -3
  4. sample_finetune.py +1 -1
README.md CHANGED
@@ -1,3 +1,265 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ license_link: https://huggingface.co/microsoft/Phi-3.5-MoE-instruct/resolve/main/LICENSE
4
+
5
+ language:
6
+ - multilingual
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - nlp
10
+ - code
11
+ widget:
12
+ - messages:
13
+ - role: user
14
+ content: Can you provide ways to eat combinations of bananas and dragonfruits?
15
+ ---
16
+
17
+ ## Model Summary
18
+
19
+ Phi-3.5-MoE is a lightweight, state-of-the-art open model built upon datasets used for Phi-3 - synthetic data and filtered publicly available documents - with a focus on very high-quality, reasoning dense data. The model supports multilingual and comes with 128K context length (in tokens). The model underwent a rigorous enhancement process, incorporating supervised fine-tuning, proximal policy optimization, and direct preference optimization to ensure precise instruction adherence and robust safety measures.
20
+
21
+ 🏡 [Phi-3 Portal](https://azure.microsoft.com/en-us/products/phi-3) <br>
22
+ 📰 [Phi-3 Microsoft Blog](https://aka.ms/phi3.5-techblog) <br>
23
+ 📖 [Phi-3 Technical Report](https://arxiv.org/abs/2404.14219) <br>
24
+ 👩‍🍳 [Phi-3 Cookbook](https://github.com/microsoft/Phi-3CookBook) <br>
25
+ 🖥️ [Try It](https://aka.ms/try-phi3.5moe) <br>
26
+
27
+ **Phi-3.5**: [[mini-instruct]](https://huggingface.co/microsoft/Phi-3.5-mini-instruct); [[MoE-instruct]](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct) ; [[vision-instruct]](https://huggingface.co/microsoft/Phi-3.5-vision-instruct)
28
+
29
+ ## Intended Uses
30
+
31
+ ### Primary Use Cases
32
+
33
+ The model is intended for commercial and research use in multiple languages. The model provides uses for general purpose AI systems and applications which require:
34
+
35
+ 1) Memory/compute constrained environments
36
+ 2) Latency bound scenarios
37
+ 3) Strong reasoning (especially code, math and logic)
38
+
39
+ Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
40
+
41
+ ### Use Case Considerations
42
+
43
+ Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fariness before using within a specific downstream use case, particularly for high risk scenarios. Developers should be aware of and adhere to applicable laws or regulations (including privacy, trade compliance laws, etc.) that are relevant to their use case.
44
+
45
+ ***Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.***
46
+
47
+ ## Usage
48
+
49
+ ### Requirements
50
+ Phi-3.5-MoE-instruct will be integrated in the official version of `transformers`. Until the official version is released through `pip`, ensure that you are doing the following:
51
+ * When loading the model, ensure that `trust_remote_code=True` is passed as an argument of the `from_pretrained()` function.
52
+
53
+ The current `transformers` version can be verified with: `pip list | grep transformers`.
54
+
55
+ Examples of required packages:
56
+ ```
57
+ flash_attn==2.5.8
58
+ torch==2.3.1
59
+ accelerate==0.31.0
60
+ transformers==4.43.0
61
+ ```
62
+
63
+ Phi-3.5-MoE-instruct is also available in [Azure AI Studio](https://aka.ms/try-phi3.5moe)
64
+
65
+ ### Tokenizer
66
+
67
+ Phi-3.5-MoE-Instruct supports a vocabulary size of up to `32064` tokens. The [tokenizer files](https://huggingface.co/microsoft/Phi-3.5-moe-instruct/blob/main/added_tokens.json) already provide placeholder tokens that can be used for downstream fine-tuning, but they can also be extended up to the model's vocabulary size.
68
+
69
+ ### Input Formats
70
+ Given the nature of the training data, the Phi-3.5-MoE-instruct model is best suited for prompts using the chat format as follows:
71
+
72
+ ```
73
+ <|system|>
74
+ You are a helpful assistant.<|end|>
75
+ <|user|>
76
+ How to explain Internet for a medieval knight?<|end|>
77
+ <|assistant|>
78
+ ```
79
+
80
+ ### Loading the model locally
81
+ After obtaining the Phi-3.5-MoE-instruct model checkpoints, users can use this sample code for inference.
82
+
83
+ ```python
84
+ import torch
85
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
86
+
87
+ torch.random.manual_seed(0)
88
+
89
+ model = AutoModelForCausalLM.from_pretrained(
90
+ "microsoft/Phi-3.5-MoE-instruct",
91
+ device_map="cuda",
92
+ torch_dtype="auto",
93
+ trust_remote_code=True,
94
+ )
95
+
96
+ tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3.5-MoE-instruct")
97
+
98
+ messages = [
99
+ {"role": "system", "content": "You are a helpful AI assistant."},
100
+ {"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
101
+ {"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
102
+ {"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
103
+ ]
104
+
105
+ pipe = pipeline(
106
+ "text-generation",
107
+ model=model,
108
+ tokenizer=tokenizer,
109
+ )
110
+
111
+ generation_args = {
112
+ "max_new_tokens": 500,
113
+ "return_full_text": False,
114
+ "temperature": 0.0,
115
+ "do_sample": False,
116
+ }
117
+
118
+ output = pipe(messages, **generation_args)
119
+ print(output[0]['generated_text'])
120
+ ```
121
+
122
+ ## Benchmarks
123
+
124
+ To understand the capabilities, we compare Phi-3.5-MoE with a set of models over a variety of benchmarks using our internal benchmark platform. At the high-level overview of the model quality on representative benchmarks:
125
+
126
+ | Category | Benchmark | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
127
+ |--|--|--|--|--|--|--|--|
128
+ | Popular aggregated benchmark | Arena Hard | 37.9 | 39.4 | 25.7 | 42.0 | 55.2 | 75.0 |
129
+ | | BigBench Hard CoT (0-shot) | 79.1 | 60.2 | 63.4 | 63.5 | 66.7 | 80.4 |
130
+ | | MMLU (5-shot) | 78.9 | 67.2 | 68.1 | 71.3 | 78.7 | 77.2 |
131
+ | | MMLU-Pro (0-shot, CoT) | 54.3 | 40.7 | 44.0 | 50.1 | 57.2 | 62.8 |
132
+ | Reasoning | ARC Challenge (10-shot) | 91.0 | 84.8 | 83.1 | 89.8 | 92.8 | 93.5 |
133
+ | | BoolQ (2-shot) | 84.6 | 82.5 | 82.8 | 85.7 | 85.8 | 88.7 |
134
+ | | GPQA (0-shot, CoT) | 36.8 | 28.6 | 26.3 | 29.2 | 37.5 | 41.1 |
135
+ | | HellaSwag (5-shot) | 83.8 | 76.7 | 73.5 | 80.9 | 67.5 | 87.1 |
136
+ | | OpenBookQA (10-shot) | 89.6 | 84.4 | 84.8 | 89.6 | 89.0 | 90.0 |
137
+ | | PIQA (5-shot) | 88.6 | 83.5 | 81.2 | 83.7 | 87.5 | 88.7 |
138
+ | | Social IQA (5-shot) | 78.0 | 75.3 | 71.8 | 74.7 | 77.8 | 82.9 |
139
+ | | TruthfulQA (MC2) (10-shot) | 77.5 | 68.1 | 69.2 | 76.6 | 76.6 | 78.2 |
140
+ | | WinoGrande (5-shot) | 81.3 | 70.4 | 64.7 | 74.0 | 74.7 | 76.9 |
141
+ | Multilingual | Multilingual MMLU (5-shot) | 69.9 | 58.9 | 56.2 | 63.8 | 77.2 | 72.9 |
142
+ | | MGSM (0-shot CoT) | 58.7 | 63.3 | 56.7 | 75.1 | 75.8 | 81.7 |
143
+ | Math | GSM8K (8-shot, CoT) | 88.7 | 84.2 | 82.4 | 84.9 | 82.4 | 91.3 |
144
+ | | MATH (0-shot, CoT) | 59.5 | 31.2 | 47.6 | 50.9 | 38.0 | 70.2 |
145
+ | Long context | Qasper | 40.0 | 30.7 | 37.2 | 13.9 | 43.5 | 39.8 |
146
+ | | SQuALITY | 24.1 | 25.8 | 26.2 | 0.0 | 23.5 | 23.8 |
147
+ | Code Generation | HumanEval (0-shot) | 70.7 | 63.4 | 66.5 | 61.0 | 74.4 | 86.6 |
148
+ | | MBPP (3-shot) | 80.8 | 68.1 | 69.4 | 69.3 | 77.5 | 84.1 |
149
+ | **Average** | | **69.2** | **61.3** | **61.0** | **63.3** | **68.5** | **74.9** |
150
+
151
+ We take a closer look at different categories across 80 public benchmark datasets at the table below:
152
+ | Category | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
153
+ |--|--|--|--|--|--|--|
154
+ | Popular aggregated benchmark | 62.6 | 51.9 | 50.3 | 56.7 | 64.5 | 73.9 |
155
+ | Reasoning | 78.7 | 72.2 | 70.5 | 75.4 | 77.7 | 80.0 |
156
+ | Language understanding | 71.8 | 67.0 | 62.9 | 72.8 | 66.6 | 76.8 |
157
+ | Robustness | 75.6 | 65.2 | 59.8 | 64.7 | 68.9 | 77.5 |
158
+ | Long context | 25.5 | 24.5 | 25.5 | 0.0 | 27.0 | 25.4 |
159
+ | Math | 74.1 | 57.7 | 65.0 | 67.9 | 60.2 | 80.8 |
160
+ | Code generation | 68.3 | 56.9 | 65.8 | 58.3 | 66.8 | 69.9 |
161
+ | Multilingual | 65.8 | 55.3 | 47.5 | 59.6 | 64.3 | 76.6 |
162
+
163
+ Overall, Phi-3.5-MoE with only **6.6B active parameters** achieves a similar level of language understanding and math as much larger models. Moreover, the model outperforms bigger models in reasoning capability and only behind GPT-4o-mini. However, it is still fundamentally limited by its size for certain tasks. The model simply does not have the capacity to store too much factual knowledge, therefore, users may experience factual incorrectness. However, we believe such weakness can be resolved by augmenting Phi-3.5 with a search engine, particularly when using the model under RAG settings.
164
+
165
+ ### Multilingual
166
+
167
+ The table below highlights multilingual capability of Phi-3.5-MoE on multilingual MMLU, MEGA, and multilingual MMLU-pro datasets. Overall, we observed that even with just 6.6B active parameters, the model is very competitive on multilingual tasks in comparison to other models with a much bigger active parameters.
168
+
169
+ | Category | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemma-2-9b-It | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
170
+ |--|--|--|--|--|--|--|
171
+ | Multilingual MMLU | 69.9 | 58.9 | 56.2 | 63.8 | 77.2 | 72.9 |
172
+ | Multilingual MMLU-Pro | 45.3 | 34.0 | 21.4 | 43.0 | 57.9 | 53.2 |
173
+ | MGSM | 58.7 | 63.3 | 56.7 | 75.1 | 75.8 | 81.7 |
174
+ | MEGA MLQA | 65.3 | 61.2 | 45.2 | 54.4 | 61.6 | 70.0 |
175
+ | MEGA TyDi QA | 67.1 | 63.7 | 54.5 | 65.6 | 63.6 | 81.8 |
176
+ | MEGA UDPOS | 60.4 | 58.2 | 54.1 | 56.6 | 62.4 | 66.0 |
177
+ | MEGA XCOPA | 76.6 | 10.8 | 21.1 | 31.2 | 95.0 | 90.3 |
178
+ | MEGA XStoryCloze | 82.8 | 92.3 | 71.0 | 87.0 | 20.7 | 96.6 |
179
+ | **Average** | **65.8** | **55.3** | **47.5** | **59.6** | **64.3** | **76.6** |
180
+
181
+ ### Long Context
182
+
183
+ Phi-3.5-MoE supports 128K context length, therefore the model is capable of several long context tasks including long document/meeting summarization, long document QA, multilingual context retrieval. We see that Phi-3.5 is clearly better than Gemma-2 family which only supports 8K context length. Phi-3.5-MoE-instruct is very competitive with other much larger open-weight models such as Llama-3.1-8B-instruct, and Mistral-Nemo-12B-instruct-2407.
184
+
185
+ | Benchmark | Phi-3.5-MoE-instruct | Mistral-Nemo-12B-instruct-2407 | Llama-3.1-8B-instruct | Gemini-1.5-Flash | GPT-4o-mini-2024-07-18 (Chat) |
186
+ |--|--|--|--|--|--|
187
+ | GovReport | 26.4 | 25.6 | 25.1 | 27.8 | 24.8 |
188
+ | QMSum | 19.9 | 22.1 | 21.6 | 24.0 | 21.7 |
189
+ | Qasper | 40.0 | 30.7 | 37.2 | 43.5 | 39.8 |
190
+ | SQuALITY | 24.1 | 25.8 | 26.2 | 23.5 | 23.8 |
191
+ | SummScreenFD | 16.9 | 18.2 | 17.6 | 16.3 | 17.0 |
192
+ | **Average** | **25.5** | **24.5** | **25.5** | **27.0** | **25.4** |
193
+
194
+ RULER: a retrieval-based benchmark for long context understanding
195
+ | Model | 4K | 8K | 16K | 32K | 64K | 128K | Average |
196
+ |--|--|--|--|--|--|--|--|
197
+ | Phi-3.5-MoE-instruct | 94.8 | 93 | 93.2 | 91.6 | 85.7 | 64.2 | **87.1** |
198
+ | Llama-3.1-8B-instruct | 95.5 | 93.8 | 91.6 | 87.4 | 84.7 | 77.0 | **88.3** |
199
+ | Mistral-Nemo-12B-instruct-2407 | 87.8 | 87.2 | 87.7 | 69.0 | 46.8 | 19.0 | **66.2** |
200
+
201
+ RepoQA: a benchmark for long context code understanding
202
+ | Model | Python | C++ | Rust | Java | TypeScript | Average |
203
+ |--|--|--|--|--|--|--|
204
+ | Phi-3.5-MoE-instruct | 89 | 74 | 81 | 88 | 95 | **85** |
205
+ | Llama-3.1-8B-instruct | 80 | 65 | 73 | 76 | 63 | **71** |
206
+ | Mistral-7B-instruct-v0.3 | 61 | 57 | 51 | 61 | 80 | **62** |
207
+
208
+ ## Training
209
+
210
+ ### Model
211
+
212
+ **Architecture:** Phi-3.5-MoE has 16x3.8B parameters with **6.6B active parameters** when using 2 experts. The model is a mixture-of-expert decoder-only Transformer model using the tokenizer with vocabulary size of 32,064.<br>
213
+ **Inputs:** Text. It is best suited for prompts using chat format.<br>
214
+ **Context length:** 128K tokens<br>
215
+ **GPUs:** 512 H100-80G<br>
216
+ **Training time:** 23 days<br>
217
+ **Training data:** 4.9T tokens<br>
218
+ **Outputs:** Generated text in response to the input<br>
219
+ **Dates:** Trained between April and August 2024<br>
220
+ **Status:** This is a static model trained on an offline dataset with cutoff date October 2023 for publicly available data. Future versions of the tuned models may be released as we improve models.<br>
221
+ **Supported languages:** Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian<br>
222
+ **Release date:** August 2024<br>
223
+
224
+ ### Training Datasets
225
+ Our training data includes a wide variety of sources, totaling 4.9 trillion tokens (including 10% multilingual), and is a combination of
226
+ 1) publicly available documents filtered rigorously for quality, selected high-quality educational data, and code;
227
+ 2) newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.);
228
+ 3) high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
229
+
230
+ We are focusing on the quality of data that could potentially improve the reasoning ability for the model, and we filter the publicly available documents to contain the correct level of knowledge. As an example, the result of a game in premier league in a particular day might be good training data for frontier models, but we need to remove such information to leave more model capacity for reasoning for the small size models. More details about data can be found in the [Phi-3 Technical Report](https://arxiv.org/pdf/2404.14219).
231
+
232
+ ## Responsible AI Considerations
233
+
234
+ Like other language models, the Phi family of models can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:
235
+ * Quality of Service: The Phi models are trained primarily on English text and some additional multilingual text. Languages other than English will experience worse performance as well as performance disparities across non-English. English language varieties with less representation in the training data might experience worse performance than standard American English.
236
+ * Multilingual performance and safety gaps: We believe it is important to make language models more widely available across different languages, but the Phi 3 models still exhibit challenges common across multilingual releases. As with any deployment of LLMs, developers will be better positioned to test for performance or safety gaps for their linguistic and cultural context and customize the model with additional fine-tuning and appropriate safeguards.
237
+ * Representation of Harms & Perpetuation of Stereotypes: These models can over- or under-represent groups of people, erase representation of some groups, or reinforce demeaning or negative stereotypes. Despite safety post-training, these limitations may still be present due to differing levels of representation of different groups, cultural contexts, or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
238
+ * Inappropriate or Offensive Content: These models may produce other types of inappropriate or offensive content, which may make it inappropriate to deploy for sensitive contexts without additional mitigations that are specific to the use case.
239
+ * Information Reliability: Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
240
+ * Limited Scope for Code: Majority of Phi-3 training data is based in Python and use common packages such as "typing, math, random, collections, datetime, itertools". If the model generates Python scripts that utilize other packages or scripts in other languages, we strongly recommend users manually verify all API uses.
241
+ * Long Conversation: Phi-3 models, like other models, can in some cases generate responses that are repetitive, unhelpful, or inconsistent in very long chat sessions in both English and non-English languages. Developers are encouraged to place appropriate mitigations, like limiting conversation turns to account for the possible conversational drift
242
+
243
+ Developers should apply responsible AI best practices, including mapping, measuring, and mitigating risks associated with their specific use case and cultural, linguistic context. Phi-3 family of models are general purpose models. As developers plan to deploy these models for specific use cases, they are encouraged to fine-tune the models for their use case and leverage the models as part of broader AI systems with language-specific safeguards in place. Important areas for consideration include:
244
+ * Allocation: Models may not be suitable for scenarios that could have consequential impact on legal status or the allocation of resources or life opportunities (ex: housing, employment, credit, etc.) without further assessments and additional debiasing techniques.
245
+ * High-Risk Scenarios: Developers should assess the suitability of using models in high-risk scenarios where unfair, unreliable or offensive outputs might be extremely costly or lead to harm. This includes providing advice in sensitive or expert domains where accuracy and reliability are critical (ex: legal or health advice). Additional safeguards should be implemented at the application level according to the deployment context.
246
+ * Misinformation: Models may produce inaccurate information. Developers should follow transparency best practices and inform end-users they are interacting with an AI system. At the application level, developers can build feedback mechanisms and pipelines to ground responses in use-case specific, contextual information, a technique known as Retrieval Augmented Generation (RAG).
247
+ * Generation of Harmful Content: Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
248
+ * Misuse: Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
249
+
250
+ ## Software
251
+ * [PyTorch](https://github.com/pytorch/pytorch)
252
+ * [Transformers](https://github.com/huggingface/transformers)
253
+ * [Flash-Attention](https://github.com/HazyResearch/flash-attention)
254
+
255
+ ## Hardware
256
+ Note that by default, the Phi-3.5-Mini-instruct model uses flash attention, which requires certain types of GPU hardware to run. We have tested on the following GPU types:
257
+ * NVIDIA A100
258
+ * NVIDIA A6000
259
+ * NVIDIA H100
260
+
261
+ ## License
262
+ The model is licensed under the [MIT license](./LICENSE).
263
+
264
+ ## Trademarks
265
+ This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "Phi-3.5-moe-instruct",
3
  "architectures": [
4
  "PhiMoEForCausalLM"
5
  ],
 
1
  {
2
+ "_name_or_path": "Phi-3.5-MoE-instruct",
3
  "architectures": [
4
  "PhiMoEForCausalLM"
5
  ],
configuration_phimoe.py CHANGED
@@ -24,7 +24,7 @@ logger = logging.get_logger(__name__)
24
 
25
 
26
  PHIMOE_PRETRAINED_CONFIG_ARCHIVE_MAP = {
27
- "microsoft/Phi-3.5-moe-instruct": "https://huggingface.co/microsoft/Phi-3.5-moe-instruct/resolve/main/config.json",
28
  }
29
 
30
  class PhiMoEConfig(PretrainedConfig):
@@ -32,7 +32,7 @@ class PhiMoEConfig(PretrainedConfig):
32
  This is the configuration class to store the configuration of a [`PhiMoEModel`]. It is used to instantiate a Phi-MoE
33
  model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
34
  defaults will yield a similar configuration to that of the
35
- [microsoft/Phi-3.5-moe-instruct](https://huggingface.co/microsoft/Phi-3.5-moe-instruct).
36
 
37
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
38
  documentation from [`PretrainedConfig`] for more information.
@@ -106,7 +106,7 @@ class PhiMoEConfig(PretrainedConfig):
106
  >>> from transformers import PhiMoEModel, PhiMoEConfig
107
 
108
  >>> # Initializing a Phi-3 style configuration
109
- >>> configuration = PhiMoEConfig.from_pretrained("microsoft/Phi-3.5-moe-instruct")
110
 
111
  >>> # Initializing a model from the configuration
112
  >>> model = PhiMoEModel(configuration)
 
24
 
25
 
26
  PHIMOE_PRETRAINED_CONFIG_ARCHIVE_MAP = {
27
+ "microsoft/Phi-3.5-MoE-instruct": "https://huggingface.co/microsoft/Phi-3.5-MoE-instruct/resolve/main/config.json",
28
  }
29
 
30
  class PhiMoEConfig(PretrainedConfig):
 
32
  This is the configuration class to store the configuration of a [`PhiMoEModel`]. It is used to instantiate a Phi-MoE
33
  model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
34
  defaults will yield a similar configuration to that of the
35
+ [microsoft/Phi-3.5-MoE-instruct](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct).
36
 
37
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
38
  documentation from [`PretrainedConfig`] for more information.
 
106
  >>> from transformers import PhiMoEModel, PhiMoEConfig
107
 
108
  >>> # Initializing a Phi-3 style configuration
109
+ >>> configuration = PhiMoEConfig.from_pretrained("microsoft/Phi-3.5-MoE-instruct")
110
 
111
  >>> # Initializing a model from the configuration
112
  >>> model = PhiMoEModel(configuration)
sample_finetune.py CHANGED
@@ -130,7 +130,7 @@ logger.info(f"PEFT parameters {peft_conf}")
130
  ################
131
  # Model Loading
132
  ################
133
- checkpoint_path = "microsoft/Phi-3.5-moe-instruct"
134
  model_kwargs = dict(
135
  use_cache=False,
136
  trust_remote_code=True,
 
130
  ################
131
  # Model Loading
132
  ################
133
+ checkpoint_path = "microsoft/Phi-3.5-MoE-instruct"
134
  model_kwargs = dict(
135
  use_cache=False,
136
  trust_remote_code=True,