Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,60 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- text-generation
|
| 5 |
+
- instruction-following
|
| 6 |
+
- smollm
|
| 7 |
+
- distillation
|
| 8 |
+
- smoltalk
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Distil-SmolLM2-135M
|
| 15 |
+
|
| 16 |
+
**Distil-SmolLM2-135M** is a distilled version of [SmolLM2-1.7B-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct), trained on a filtered subset of the [Smoltalk dataset](https://huggingface.co/datasets/HuggingFaceTB/smoltalk). This release aims to provide a more capable and performant ultra-small 135M generative large language model for small tasks on-edge or at-scale.
|
| 17 |
+
|
| 18 |
+
## Model Details
|
| 19 |
+
|
| 20 |
+
* **Student Model:** [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) (this model)
|
| 21 |
+
* **Teacher Model:** [SmolLM2-1.7B-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct)
|
| 22 |
+
* **Parameters:** ~135 Million
|
| 23 |
+
* **Language:** English
|
| 24 |
+
* **Description:** This model was created by distilling the knowledge from `SmolLM2-1.7B-Instruct` into `SmolLM2-135M-Instruct`. The distillation process utilized the Smoltalk dataset, with specific exclusions.
|
| 25 |
+
|
| 26 |
+
## Intended Uses & Limitations
|
| 27 |
+
|
| 28 |
+
**Intended Uses:**
|
| 29 |
+
This model is intended for research, experimentation, and general use in instruction-following and chat applications where a smaller model footprint is desired. It can be used for:
|
| 30 |
+
* Answering questions based on provided context.
|
| 31 |
+
* Classifying text.
|
| 32 |
+
* Simple conversational tasks.
|
| 33 |
+
* More complex tasks upon further fine-tuning.
|
| 34 |
+
|
| 35 |
+
**Limitations:**
|
| 36 |
+
* **Reduced Capacity:** Being a smaller model (135M parameters), its performance will generally be significantly lower than its larger teacher model (1.7B parameters) and other state-of-the-art large language models, especially on complex reasoning or knowledge-intensive tasks.
|
| 37 |
+
* **Hallucinations:** Like all LLMs, this model can generate incorrect or nonsensical information (hallucinate).
|
| 38 |
+
* **Bias:** The model may reflect biases present in the training data.
|
| 39 |
+
* **Safety:** The model has not undergone extensive safety fine-tuning or alignment beyond the original instruction tuning of the teacher. It may generate harmful, unethical, or offensive content. Use with caution and appropriate safeguards.
|
| 40 |
+
* **Dataset Exclusions:** The model was not trained on the `apigen-80k` or `longalign` sources from Smoltalk, which might affect its performance on tasks related to function calling or very long context alignment.
|
| 41 |
+
|
| 42 |
+
## How to Get Started
|
| 43 |
+
|
| 44 |
+
You can use this model with the `transformers` library for text generation tasks.
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 48 |
+
|
| 49 |
+
model_name = "OxxoCodes/distil-SmolLM2-135M-Instruct"
|
| 50 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 51 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 52 |
+
|
| 53 |
+
# Make sure to use a prompt format the model was trained on
|
| 54 |
+
# This example uses a generic instruction format.
|
| 55 |
+
# Refer to SmolLM2-1.7B-Instruct or SmolLM2-135M-Instruct for specific prompt templates if applicable.
|
| 56 |
+
prompt = f"<|im_start|>system\nYou are a helpful AI assistant.<|im_end|>\n<|im_start|>user\nWhat is the world's largest sea mammal?\n<|im_end|>\n<|im_start|>assistant\n"
|
| 57 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 58 |
+
|
| 59 |
+
outputs = model.generate(**inputs, max_new_tokens=50, num_return_sequences=1, temperature=0.3, top_p=0.95)
|
| 60 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|