Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- starhopp3r/TinyChat
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- tiny
|
| 9 |
+
- chat
|
| 10 |
+
- small
|
| 11 |
+
- cpu
|
| 12 |
+
- open
|
| 13 |
+
- open-source
|
| 14 |
+
- gpt2
|
| 15 |
+
- gpt
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Welcome to 🤏 Pin Model Series
|
| 19 |
+
The models in the LH-Tech AI Pin Series are very small models that were trained on starhopp3r/TinyChat.
|
| 20 |
+
|
| 21 |
+
## Models overview
|
| 22 |
+
| Model | Parameters | Training iters | Final Train Loss | Quality | Example Chat |
|
| 23 |
+
|:----|:----|:----|:----|:----|:----|
|
| 24 |
+
| Pin-5M | 5.37M | 1000 | 3.170788 | Poor | *User:* What is the weather like today? *Pin:* Yes, a bright day is shining and makes everything have a good day a lot. |
|
| 25 |
+
| Pin-10M | 10.06M | 1500 | 2.562048 | Poor | *User:* What is the weather like today? *Pin:* That sounds nice, I agree, it is nice to talk about new ideas. |
|
| 26 |
+
| Pin-15M | 14.84M | 1500 | 2.XXXXXX | | *User:* What is the weather like today? *Pin:* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
|
| 27 |
+
| Pin-20M | XX.XXM | 1500 | 2.XXXXXX | | *User:* What is the weather like today? *Pin:* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
|
| 28 |
+
| Pin-25M | XX.XXM | 1500 | 2.XXXXXX | | *User:* What is the weather like today? *Pin:* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
|
| 29 |
+
|
| 30 |
+
## Training
|
| 31 |
+
### Training data
|
| 32 |
+
We trained on [starhopp3r/TinyChat](https://huggingface.co/datasets/starhopp3r/TinyChat) and used the gpt-2 tokenizer.
|
| 33 |
+
|
| 34 |
+
### Training code/scripts
|
| 35 |
+
You can find the full training code for the Pin Model Series in this repo.<br>
|
| 36 |
+
**Tip:** If you want to train one of these models yourself, make sure to adjust the model config like this:
|
| 37 |
+
| Model | n\_layer | n\_head | n\_embd | n\_inner |
|
| 38 |
+
| :---- | :---- | :---- | :---- | :---- |
|
| 39 |
+
| **Pin-5M** | 4 | 8 | 96 | 384 |
|
| 40 |
+
| **Pin-10M** | 6 | 8 | 160 | 640 |
|
| 41 |
+
| **Pin-15M** | *8* | *8* | *208* | *832* |
|
| 42 |
+
| **Pin-20M** | *10* | *8* | *256* | *1024* |
|
| 43 |
+
| **Pin-25M** | *12* | *12* | *288* | *1152* |
|
| 44 |
+
|
| 45 |
+
Have fun :D
|
| 46 |
+
|
| 47 |
+
### Training details
|
| 48 |
+
We trained all these models in under 25 minutes on a single T4 GPU in a Kaggle Session.<br>
|
| 49 |
+
So you are able to easily recreate all of the Pin model without having to launch a 8xH100 cluster 😂
|
| 50 |
+
|
| 51 |
+
## How to use the model
|
| 52 |
+
You can easily use the favorite model of the Pin series like this:
|
| 53 |
+
|
| 54 |
+
1. Download `use.py` from this repo.
|
| 55 |
+
2. Adjust the subfolder argument here:
|
| 56 |
+
```python
|
| 57 |
+
answer = run_pin_inference(user_query, model_id="LH-Tech-AI/Pin", subfolder="Pin-5M") # use your favorite model here, e.g. "Pin-25M" or "Pin-15M"...
|
| 58 |
+
```
|
| 59 |
+
3. Adjust the input prompt here:
|
| 60 |
+
```python
|
| 61 |
+
user_query = "What is the weather like today?" # insert your prompt here
|
| 62 |
+
```
|
| 63 |
+
4. Launch it with Torch installed in Python3.
|
| 64 |
+
5. Have fun :D
|
| 65 |
+
|
| 66 |
+
## Acknowledgements...
|
| 67 |
+
...to:
|
| 68 |
+
|
| 69 |
+
- HF Transformers
|
| 70 |
+
- Kaggle for the T4 GPU
|
| 71 |
+
- starhopp3r for his TinyChat dataset
|