Update README.md
Browse files
LICENSE
CHANGED
@@ -1,366 +1,119 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
FP16. However, llamafile is able to still offer respectable tinyBLAS
|
121 |
-
speedups for llama.cpp's simplest quants: Q8\_0 and Q4\_0.
|
122 |
-
|
123 |
-
--
|
124 |
-
|
125 |
-
## Model Summary
|
126 |
-
|
127 |
-
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.
|
128 |
-
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) that it can support.
|
129 |
-
|
130 |
-
The model has underwent a post-training process that incorporates both supervised fine-tuning and direct preference optimization for the instruction following and safety measures.
|
131 |
-
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.
|
132 |
-
|
133 |
-
Resources and Technical Documentation:
|
134 |
-
|
135 |
-
+ [Phi-3 Microsoft Blog](https://aka.ms/phi3blog-april)
|
136 |
-
+ [Phi-3 Technical Report](https://aka.ms/phi3-tech-report)
|
137 |
-
+ [Phi-3 on Azure AI Studio](https://aka.ms/phi3-azure-ai)
|
138 |
-
+ Phi-3 GGUF: [4K](https://aka.ms/Phi3-mini-4k-instruct-gguf)
|
139 |
-
+ Phi-3 ONNX: [4K](https://aka.ms/Phi3-mini-4k-instruct-onnx)
|
140 |
-
|
141 |
-
## Intended Uses
|
142 |
-
|
143 |
-
**Primary use cases**
|
144 |
-
|
145 |
-
The model is intended for commercial and research use in English. The model provides uses for applications which require:
|
146 |
-
|
147 |
-
1) Memory/compute constrained environments
|
148 |
-
2) Latency bound scenarios
|
149 |
-
3) Strong reasoning (especially code, math and logic)
|
150 |
-
|
151 |
-
Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.
|
152 |
-
|
153 |
-
**Use case considerations**
|
154 |
-
|
155 |
-
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.
|
156 |
-
|
157 |
-
Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.
|
158 |
-
|
159 |
-
## How to Use
|
160 |
-
|
161 |
-
Phi-3 Mini-4K-Instruct has been integrated in the development version (4.40.0) of `transformers`. Until the official version is released through `pip`, ensure that you are doing one of the following:
|
162 |
-
|
163 |
-
* When loading the model, ensure that `trust_remote_code=True` is passed as an argument of the `from_pretrained()` function.
|
164 |
-
|
165 |
-
* Update your local `transformers` to the development version: `pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers`. The previous command is an alternative to cloning and installing from the source.
|
166 |
-
|
167 |
-
The current `transformers` version can be verified with: `pip list | grep transformers`.
|
168 |
-
|
169 |
-
Phi-3 Mini-4K-Instruct is also available in [HuggingChat](https://aka.ms/try-phi3-hf-chat).
|
170 |
-
|
171 |
-
### Tokenizer
|
172 |
-
|
173 |
-
Phi-3 Mini-4K-Instruct supports a vocabulary size of up to `32064` tokens. The [tokenizer files](https://huggingface.co/microsoft/Phi-3-mini-4k-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.
|
174 |
-
|
175 |
-
### Chat Format
|
176 |
-
|
177 |
-
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.
|
178 |
-
You can provide the prompt as a question with a generic template as follow:
|
179 |
-
```markdown
|
180 |
-
<|user|>\nQuestion <|end|>\n<|assistant|>
|
181 |
-
```
|
182 |
-
For example:
|
183 |
-
```markdown
|
184 |
-
<|system|>
|
185 |
-
You are a helpful AI assistant.<|end|>
|
186 |
-
<|user|>
|
187 |
-
How to explain Internet for a medieval knight?<|end|>
|
188 |
-
<|assistant|>
|
189 |
-
```
|
190 |
-
|
191 |
-
where the model generates the text after `<|assistant|>` . In case of few-shots prompt, the prompt can be formatted as the following:
|
192 |
-
|
193 |
-
```markdown
|
194 |
-
<|system|>
|
195 |
-
You are a helpful AI assistant.<|end|>
|
196 |
-
<|user|>
|
197 |
-
I am going to Paris, what should I see?<|end|>
|
198 |
-
<|assistant|>
|
199 |
-
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|>
|
200 |
-
<|user|>
|
201 |
-
What is so great about #1?<|end|>
|
202 |
-
<|assistant|>
|
203 |
-
```
|
204 |
-
|
205 |
-
### Sample inference code
|
206 |
-
|
207 |
-
This code snippets show how to get quickly started with running the model on a GPU:
|
208 |
-
|
209 |
-
```python
|
210 |
-
import torch
|
211 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
212 |
-
|
213 |
-
torch.random.manual_seed(0)
|
214 |
-
|
215 |
-
model = AutoModelForCausalLM.from_pretrained(
|
216 |
-
"microsoft/Phi-3-mini-4k-instruct",
|
217 |
-
device_map="cuda",
|
218 |
-
torch_dtype="auto",
|
219 |
-
trust_remote_code=True,
|
220 |
-
)
|
221 |
-
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
222 |
-
|
223 |
-
messages = [
|
224 |
-
{"role": "system", "content": "You are a helpful digital assistant. Please provide safe, ethical and accurate information to the user."},
|
225 |
-
{"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
|
226 |
-
{"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."},
|
227 |
-
{"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
|
228 |
-
]
|
229 |
-
|
230 |
-
pipe = pipeline(
|
231 |
-
"text-generation",
|
232 |
-
model=model,
|
233 |
-
tokenizer=tokenizer,
|
234 |
-
)
|
235 |
-
|
236 |
-
generation_args = {
|
237 |
-
"max_new_tokens": 500,
|
238 |
-
"return_full_text": False,
|
239 |
-
"temperature": 0.0,
|
240 |
-
"do_sample": False,
|
241 |
-
}
|
242 |
-
|
243 |
-
output = pipe(messages, **generation_args)
|
244 |
-
print(output[0]['generated_text'])
|
245 |
-
```
|
246 |
-
|
247 |
-
*Some applications/frameworks might not include a BOS token (`<s>`) at the start of the conversation. Please ensure that it is included since it provides more reliable results.*
|
248 |
-
|
249 |
-
## Responsible AI Considerations
|
250 |
-
|
251 |
-
Like other language models, the Phi series models can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:
|
252 |
-
|
253 |
-
+ Quality of Service: the Phi models are trained primarily on English text. Languages other than English will experience worse performance. English language varieties with less representation in the training data might experience worse performance than standard American English.
|
254 |
-
+ 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 or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
|
255 |
-
+ 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.
|
256 |
-
+ Information Reliability: Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
|
257 |
-
+ 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.
|
258 |
-
|
259 |
-
Developers should apply responsible AI best practices and are responsible for ensuring that a specific use case complies with relevant laws and regulations (e.g. privacy, trade, etc.). Important areas for consideration include:
|
260 |
-
|
261 |
-
+ 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.
|
262 |
-
+ High-Risk Scenarios: Developers should assess 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.
|
263 |
-
+ 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).
|
264 |
-
+ Generation of Harmful Content: Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
|
265 |
-
+ 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.
|
266 |
-
|
267 |
-
|
268 |
-
## Training
|
269 |
-
|
270 |
-
### Model
|
271 |
-
|
272 |
-
* Architecture: Phi-3 Mini-4K-Instruct has 3.8B parameters and is a dense decoder-only Transformer model. The model is fine-tuned with Supervised fine-tuning (SFT) and Direct Preference Optimization (DPO) to ensure alignment with human preferences and safety guidlines.
|
273 |
-
* Inputs: Text. It is best suited for prompts using chat format.
|
274 |
-
* Context length: 4K tokens
|
275 |
-
* GPUs: 512 H100-80G
|
276 |
-
* Training time: 7 days
|
277 |
-
* Training data: 3.3T tokens
|
278 |
-
* Outputs: Generated text in response to the input
|
279 |
-
* Dates: Our models were trained between February and April 2024
|
280 |
-
* Status: This is a static model trained on an offline dataset with cutoff date October 2023. Future versions of the tuned models may be released as we improve models.
|
281 |
-
|
282 |
-
### Datasets
|
283 |
-
|
284 |
-
Our training data includes a wide variety of sources, totaling 3.3 trillion tokens, and is a combination of
|
285 |
-
1) Publicly available documents filtered rigorously for quality, selected high-quality educational data, and code;
|
286 |
-
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.);
|
287 |
-
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.
|
288 |
-
|
289 |
-
### Fine-tuning
|
290 |
-
|
291 |
-
A basic example of multi-GPUs supervised fine-tuning (SFT) with TRL and Accelerate modules is provided [here](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/sample_finetune.py).
|
292 |
-
|
293 |
-
## Benchmarks
|
294 |
-
|
295 |
-
We report the results for Phi-3-Mini-4K-Instruct on standard open-source benchmarks measuring the model's reasoning ability (both common sense reasoning and logical reasoning). We compare to Phi-2, Mistral-7b-v0.1, Mixtral-8x7b, Gemma 7B, Llama-3-8B-Instruct, and GPT-3.5.
|
296 |
-
|
297 |
-
All the reported numbers are produced with the exact same pipeline to ensure that the numbers are comparable. These numbers might differ from other published numbers due to slightly different choices in the evaluation.
|
298 |
-
|
299 |
-
As is now standard, we use few-shot prompts to evaluate the models, at temperature 0.
|
300 |
-
The prompts and number of shots are part of a Microsoft internal tool to evaluate language models, and in particular we did no optimization to the pipeline for Phi-3.
|
301 |
-
More specifically, we do not change prompts, pick different few-shot examples, change prompt format, or do any other form of optimization for the model.
|
302 |
-
|
303 |
-
The number of k–shot examples is listed per-benchmark.
|
304 |
-
|
305 |
-
| | Phi-3-Mini-4K-In<br>3.8b | Phi-3-Small<br>7b (preview) | Phi-3-Medium<br>14b (preview) | Phi-2<br>2.7b | Mistral<br>7b | Gemma<br>7b | Llama-3-In<br>8b | Mixtral<br>8x7b | GPT-3.5<br>version 1106 |
|
306 |
-
|---|---|---|---|---|---|---|---|---|---|
|
307 |
-
| MMLU <br>5-Shot | 68.8 | 75.3 | 78.2 | 56.3 | 61.7 | 63.6 | 66.5 | 68.4 | 71.4 |
|
308 |
-
| HellaSwag <br> 5-Shot | 76.7 | 78.7 | 83.2 | 53.6 | 58.5 | 49.8 | 71.1 | 70.4 | 78.8 |
|
309 |
-
| ANLI <br> 7-Shot | 52.8 | 55.0 | 58.7 | 42.5 | 47.1 | 48.7 | 57.3 | 55.2 | 58.1 |
|
310 |
-
| GSM-8K <br> 0-Shot; CoT | 82.5 | 86.4 | 90.8 | 61.1 | 46.4 | 59.8 | 77.4 | 64.7 | 78.1 |
|
311 |
-
| MedQA <br> 2-Shot | 53.8 | 58.2 | 69.8 | 40.9 | 49.6 | 50.0 | 60.5 | 62.2 | 63.4 |
|
312 |
-
| AGIEval <br> 0-Shot | 37.5 | 45.0 | 49.7 | 29.8 | 35.1 | 42.1 | 42.0 | 45.2 | 48.4 |
|
313 |
-
| TriviaQA <br> 5-Shot | 64.0 | 59.1 | 73.3 | 45.2 | 72.3 | 75.2 | 67.7 | 82.2 | 85.8 |
|
314 |
-
| Arc-C <br> 10-Shot | 84.9 | 90.7 | 91.9 | 75.9 | 78.6 | 78.3 | 82.8 | 87.3 | 87.4 |
|
315 |
-
| Arc-E <br> 10-Shot | 94.6 | 97.1 | 98.0 | 88.5 | 90.6 | 91.4 | 93.4 | 95.6 | 96.3 |
|
316 |
-
| PIQA <br> 5-Shot | 84.2 | 87.8 | 88.2 | 60.2 | 77.7 | 78.1 | 75.7 | 86.0 | 86.6 |
|
317 |
-
| SociQA <br> 5-Shot | 76.6 | 79.0 | 79.4 | 68.3 | 74.6 | 65.5 | 73.9 | 75.9 | 68.3 |
|
318 |
-
| BigBench-Hard <br> 0-Shot | 71.7 | 75.0 | 82.5 | 59.4 | 57.3 | 59.6 | 51.5 | 69.7 | 68.32 |
|
319 |
-
| WinoGrande <br> 5-Shot | 70.8 | 82.5 | 81.2 | 54.7 | 54.2 | 55.6 | 65 | 62.0 | 68.8 |
|
320 |
-
| OpenBookQA <br> 10-Shot | 83.2 | 88.4 | 86.6 | 73.6 | 79.8 | 78.6 | 82.6 | 85.8 | 86.0 |
|
321 |
-
| BoolQ <br> 0-Shot | 77.6 | 82.9 | 86.5 | -- | 72.2 | 66.0 | 80.9 | 77.6 | 79.1 |
|
322 |
-
| CommonSenseQA <br> 10-Shot | 80.2 | 80.3 | 82.6 | 69.3 | 72.6 | 76.2 | 79 | 78.1 | 79.6 |
|
323 |
-
| TruthfulQA <br> 10-Shot | 65.0 | 68.1 | 74.8 | -- | 52.1 | 53.0 | 63.2 | 60.1 | 85.8 |
|
324 |
-
| HumanEval <br> 0-Shot | 59.1 | 59.1 | 54.7 | 47.0 | 28.0 | 34.1 | 60.4 | 37.8 | 62.2 |
|
325 |
-
| MBPP <br> 3-Shot | 53.8 | 71.4 | 73.7 | 60.6 | 50.8 | 51.5 | 67.7 | 60.2 | 77.8 |
|
326 |
-
|
327 |
-
## Software
|
328 |
-
|
329 |
-
* [PyTorch](https://github.com/pytorch/pytorch)
|
330 |
-
* [DeepSpeed](https://github.com/microsoft/DeepSpeed)
|
331 |
-
* [Transformers](https://github.com/huggingface/transformers)
|
332 |
-
* [Flash-Attention](https://github.com/HazyResearch/flash-attention)
|
333 |
-
|
334 |
-
## Hardware
|
335 |
-
Note that by default, the Phi-3-mini model uses flash attention, which requires certain types of GPU hardware to run. We have tested on the following GPU types:
|
336 |
-
* NVIDIA A100
|
337 |
-
* NVIDIA A6000
|
338 |
-
* NVIDIA H100
|
339 |
-
|
340 |
-
If you want to run the model on:
|
341 |
-
* NVIDIA V100 or earlier generation GPUs: call AutoModelForCausalLM.from_pretrained() with attn_implementation="eager"
|
342 |
-
* CPU: use the **GGUF** quantized models [4K](https://aka.ms/Phi3-mini-4k-instruct-gguf)
|
343 |
-
+ Optimized inference on GPU, CPU, and Mobile: use the **ONNX** models [4K](https://aka.ms/Phi3-mini-4k-instruct-onnx)
|
344 |
-
|
345 |
-
|
346 |
-
## Cross Platform Support
|
347 |
-
|
348 |
-
ONNX runtime ecosystem now supports Phi-3 Mini models across platforms and hardware. You can find the optimized Phi-3 Mini-4K-Instruct ONNX model [here](https://aka.ms/phi3-mini-4k-instruct-onnx).
|
349 |
-
|
350 |
-
Optimized Phi-3 models are also published here in ONNX format, to run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, Linux and Mac desktops, and mobile CPUs, with the precision best suited to each of these targets. DirectML support lets developers bring hardware acceleration to Windows devices at scale across AMD, Intel, and NVIDIA GPUs.
|
351 |
-
Along with DirectML, ONNX Runtime provides cross platform support for Phi-3 across a range of devices CPU, GPU, and mobile.
|
352 |
-
|
353 |
-
Here are some of the optimized configurations we have added:
|
354 |
-
|
355 |
-
1. ONNX models for int4 DML: Quantized to int4 via AWQ
|
356 |
-
2. ONNX model for fp16 CUDA
|
357 |
-
3. ONNX model for int4 CUDA: Quantized to int4 via RTN
|
358 |
-
4. ONNX model for int4 CPU and Mobile: Quantized to int4 via RTN
|
359 |
-
|
360 |
-
## License
|
361 |
-
|
362 |
-
The model is licensed under the [MIT license](https://huggingface.co/microsoft/Phi-3-mini-4k/resolve/main/LICENSE).
|
363 |
-
|
364 |
-
## Trademarks
|
365 |
-
|
366 |
-
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.
|
|
|
1 |
+
Microsoft.
|
2 |
+
Copyright (c) Microsoft Corporation.
|
3 |
+
|
4 |
+
MIT License
|
5 |
+
|
6 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
+
of this software and associated documentation files (the "Software"), to deal
|
8 |
+
in the Software without restriction, including without limitation the rights
|
9 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
+
copies of the Software, and to permit persons to whom the Software is
|
11 |
+
furnished to do so, subject to the following conditions:
|
12 |
+
|
13 |
+
The above copyright notice and this permission notice shall be included in all
|
14 |
+
copies or substantial portions of the Software.
|
15 |
+
|
16 |
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22 |
+
SOFTWARE.
|
23 |
+
|
24 |
+
llamafile (Apache 2.0)
|
25 |
+
Copyright 2023 Mozilla Foundation
|
26 |
+
|
27 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
28 |
+
you may not use this file except in compliance with the License.
|
29 |
+
You may obtain a copy of the License at
|
30 |
+
|
31 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
32 |
+
|
33 |
+
Unless required by applicable law or agreed to in writing, software
|
34 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
35 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
36 |
+
See the License for the specific language governing permissions and
|
37 |
+
limitations under the License."
|
38 |
+
|
39 |
+
Cosmopolitan
|
40 |
+
Copyright 2024 Justine Alexandra Roberts Tunney
|
41 |
+
|
42 |
+
Permission to use, copy, modify, and/or distribute this software for
|
43 |
+
any purpose with or without fee is hereby granted, provided that the
|
44 |
+
above copyright notice and this permission notice appear in all copies.
|
45 |
+
|
46 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
47 |
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
48 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
49 |
+
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
50 |
+
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
51 |
+
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
52 |
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
53 |
+
PERFORMANCE OF THIS SOFTWARE.
|
54 |
+
|
55 |
+
llama.cpp (MIT License)
|
56 |
+
Copyright (c) 2023 Georgi Gerganov
|
57 |
+
Copyright (c) 2023 Iwan Kawrakow
|
58 |
+
Copyright (c) 2023 Jeffrey Quesnelle and Bowen Peng.
|
59 |
+
Copyright (c) 2023 Yuji Hirose
|
60 |
+
Copyright (c) 2022 Niels Lohmann <https://nlohmann.me>
|
61 |
+
Copyright (c) 2022 Bjoern Hoehrmann <[email protected]>
|
62 |
+
Copyright (c) 2017 Sean Barrett
|
63 |
+
|
64 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
65 |
+
of this software and associated documentation files (the "Software"), to deal
|
66 |
+
in the Software without restriction, including without limitation the rights
|
67 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
68 |
+
copies of the Software, and to permit persons to whom the Software is
|
69 |
+
furnished to do so, subject to the following conditions:
|
70 |
+
|
71 |
+
The above copyright notice and this permission notice shall be included in all
|
72 |
+
copies or substantial portions of the Software.
|
73 |
+
|
74 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
75 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
76 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
77 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
78 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
79 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
80 |
+
SOFTWARE.
|
81 |
+
|
82 |
+
strftime (BSD-3)
|
83 |
+
Copyright 1989 The Regents of the University of California
|
84 |
+
|
85 |
+
*NSYNC (Apache 2.0)
|
86 |
+
Copyright 2016 Google, Inc.
|
87 |
+
https://github.com/google/nsync
|
88 |
+
|
89 |
+
puff (zlib License)
|
90 |
+
Copyright 2002-2013 Mark Adler
|
91 |
+
|
92 |
+
Smoothsort (MIT License)
|
93 |
+
Copyright 2011 Valentin Ochs
|
94 |
+
Discovered by Edsger Dijkstra
|
95 |
+
|
96 |
+
OpenBSD Strings (ISC)
|
97 |
+
Copyright (c) 1998, 2015 Todd C. Miller <[email protected]>
|
98 |
+
|
99 |
+
Optimized Routines (MIT License)
|
100 |
+
Copyright 2022 ARM Limited
|
101 |
+
|
102 |
+
FreeBSD libm (BSD-2 License)
|
103 |
+
Copyright (c) 1992-2024 The FreeBSD Project.
|
104 |
+
Copyright (c) 2005-2011 Bruce D. Evans, Steven G. Kargl, David Schultz
|
105 |
+
Copyright (c) 2009-2013 Steven G. Kargl
|
106 |
+
|
107 |
+
fdlibm (fdlibm license)
|
108 |
+
Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
109 |
+
|
110 |
+
Musl libc (MIT License)
|
111 |
+
Copyright 2005-2014 Rich Felker, et. al.
|
112 |
+
|
113 |
+
gdtoa (MIT License)
|
114 |
+
The author of this software is David M. Gay
|
115 |
+
Kudos go to Guy L. Steele, Jr. and Jon L. White
|
116 |
+
Copyright (C) 1997, 1998, 2000 by Lucent Technologies
|
117 |
+
|
118 |
+
OpenBSD Sorting (BSD-3)
|
119 |
+
Copyright 1993 The Regents of the University of California
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|