Instructions to use SmallDoge/Doge-20M-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SmallDoge/Doge-20M-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="SmallDoge/Doge-20M-Instruct", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SmallDoge/Doge-20M-Instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("SmallDoge/Doge-20M-Instruct", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,6 +3,7 @@ library_name: transformers
|
|
| 3 |
license: apache-2.0
|
| 4 |
datasets:
|
| 5 |
- HuggingFaceTB/smoltalk
|
|
|
|
| 6 |
base_model:
|
| 7 |
- JingzeShi/Doge-20M
|
| 8 |
language:
|
|
@@ -13,9 +14,11 @@ pipeline_tag: question-answering
|
|
| 13 |
|
| 14 |
# **Doge 20M Instruct**
|
| 15 |
|
|
|
|
|
|
|
| 16 |
Doge is an ongoing research project where we aim to train a series of small language models to further explore whether the Transformer framework allows for more complex feedforward network structures, enabling the model to have fewer cache states and larger knowledge capacity.
|
| 17 |
|
| 18 |
-
In addition, Doge uses Dynamic Mask Attention as sequence transformation and can use Multi-Layer Perceptron or Cross Domain Mixture of Experts as state transformation. Dynamic Mask Attention allows the Transformer to use self-attention during training and state space during inference, and Cross Domain Mixture of Experts can directly inherit the weights of Multi-Layer Perceptron for further training. This model is trained by Jingze Shi, it only allows text input and text generation, for detailed algorithm and model architecture, please refer to [Wonderful Matrices](https://arxiv.org/abs/2412.11834),
|
| 19 |
|
| 20 |
|
| 21 |
## Uses
|
|
@@ -31,12 +34,15 @@ generation_config = GenerationConfig(
|
|
| 31 |
use_cache=True,
|
| 32 |
do_sample=True,
|
| 33 |
temperature=0.8,
|
|
|
|
| 34 |
repetition_penalty=1.0
|
| 35 |
)
|
| 36 |
steamer = TextStreamer(
|
| 37 |
tokenizer=tokenizer,
|
| 38 |
skip_prompt=True
|
| 39 |
)
|
|
|
|
|
|
|
| 40 |
conversation = [
|
| 41 |
{"role": "user", "content": prompt}
|
| 42 |
]
|
|
@@ -57,16 +63,34 @@ outputs = model.generate(
|
|
| 57 |
|
| 58 |
## Model Details
|
| 59 |
|
|
|
|
|
|
|
| 60 |
> TODO: The larger model is under training and will be uploaded soon.
|
| 61 |
|
| 62 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
| Model | Training Data | Epochs | Content Length | LR | Batch Size | Precision |
|
| 64 |
|---|---|---|---|---|---|---|
|
| 65 |
-
| [Doge-20M-Instruct](https://huggingface.co/JingzeShi/Doge-20M-Instruct) | [
|
| 66 |
-
| [Doge-60M-Instruct](https://huggingface.co/JingzeShi/Doge-60M-Instruct) | [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
**Environment**:
|
| 69 |
-
- Image: nvcr.io/nvidia/pytorch:24.
|
| 70 |
- Hardware: 1x NVIDIA RTX 4090
|
| 71 |
- Software: Transformers, TRL
|
| 72 |
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
datasets:
|
| 5 |
- HuggingFaceTB/smoltalk
|
| 6 |
+
- HuggingFaceH4/ultrafeedback_binarized
|
| 7 |
base_model:
|
| 8 |
- JingzeShi/Doge-20M
|
| 9 |
language:
|
|
|
|
| 14 |
|
| 15 |
# **Doge 20M Instruct**
|
| 16 |
|
| 17 |
+

|
| 18 |
+
|
| 19 |
Doge is an ongoing research project where we aim to train a series of small language models to further explore whether the Transformer framework allows for more complex feedforward network structures, enabling the model to have fewer cache states and larger knowledge capacity.
|
| 20 |
|
| 21 |
+
In addition, Doge uses Dynamic Mask Attention as sequence transformation and can use Multi-Layer Perceptron or Cross Domain Mixture of Experts as state transformation. Dynamic Mask Attention allows the Transformer to use self-attention during training and state space during inference, and Cross Domain Mixture of Experts can directly inherit the weights of Multi-Layer Perceptron for further training. This model is trained by Jingze Shi, it only allows text input and text generation, for detailed algorithm and model architecture, please refer to [Wonderful Matrices](https://arxiv.org/abs/2412.11834), all training details are in [here](https://github.com/LoserCheems/WonderfulMatrices).
|
| 22 |
|
| 23 |
|
| 24 |
## Uses
|
|
|
|
| 34 |
use_cache=True,
|
| 35 |
do_sample=True,
|
| 36 |
temperature=0.8,
|
| 37 |
+
top_p=0.9,
|
| 38 |
repetition_penalty=1.0
|
| 39 |
)
|
| 40 |
steamer = TextStreamer(
|
| 41 |
tokenizer=tokenizer,
|
| 42 |
skip_prompt=True
|
| 43 |
)
|
| 44 |
+
|
| 45 |
+
prompt = "Hi, how are you doing today?"
|
| 46 |
conversation = [
|
| 47 |
{"role": "user", "content": prompt}
|
| 48 |
]
|
|
|
|
| 63 |
|
| 64 |
## Model Details
|
| 65 |
|
| 66 |
+
We build the Doge-Instruct by first SFT on [SmolTalk](https://huggingface.co/datasets/HuggingFaceTB/smoltalk) and then DPO on [UltraFeedback Binarized](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized).
|
| 67 |
+
|
| 68 |
> TODO: The larger model is under training and will be uploaded soon.
|
| 69 |
|
| 70 |
+
**SFT**:
|
| 71 |
+
| Model | Training Data | Epochs | Content Length | LR | Batch Size | Precision |
|
| 72 |
+
|---|---|---|---|---|---|---|
|
| 73 |
+
| [Doge-20M-Instruct-SFT](https://huggingface.co/JingzeShi/Doge-20M-Instruct-SFT) | [HuggingFaceTB/smoltalk](https://huggingface.co/datasets/HuggingFaceTB/smoltalk) | 2 | 8192 | 8e-4 | 1M | bfloat16 |
|
| 74 |
+
| [Doge-60M-Instruct](https://huggingface.co/JingzeShi/Doge-60M-Instruct) | [HuggingFaceTB/smoltalk](https://huggingface.co/datasets/HuggingFaceTB/smoltalk) | 2 | 8192 | 6e-4 | 1M | bfloat16 |
|
| 75 |
+
|
| 76 |
+
**DPO**:
|
| 77 |
| Model | Training Data | Epochs | Content Length | LR | Batch Size | Precision |
|
| 78 |
|---|---|---|---|---|---|---|
|
| 79 |
+
| [Doge-20M-Instruct](https://huggingface.co/JingzeShi/Doge-20M-Instruct) | [HuggingFaceH4/ultrafeedback_binarized](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized) | 2 | 1024 | 8e-5 | 0.125M | bfloat16 |
|
| 80 |
+
| [Doge-60M-Instruct](https://huggingface.co/JingzeShi/Doge-60M-Instruct) | [HuggingFaceH4/ultrafeedback_binarized](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized) | 2 | 1024 | 6e-5 | 0.125M | bfloat16 |
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
**Procedure**:
|
| 84 |
+
|
| 85 |
+
**SFT**:
|
| 86 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/loser_cheems/huggingface/runs/xl21ytg8)
|
| 87 |
+
|
| 88 |
+
**DPO**:
|
| 89 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/loser_cheems/huggingface/runs/874wshj2)
|
| 90 |
+
|
| 91 |
|
| 92 |
**Environment**:
|
| 93 |
+
- Image: nvcr.io/nvidia/pytorch:24.12-py3
|
| 94 |
- Hardware: 1x NVIDIA RTX 4090
|
| 95 |
- Software: Transformers, TRL
|
| 96 |
|