Upload 2 files
Browse files- README_en.md +96 -0
- axolotl_config_qrwpz281.yml +78 -0
README_en.md
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# TinyLlama-1.1B Intermediate Step Model
|
3 |
+
|
4 |
+
This repository contains the pre-trained model `TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T`, fine-tuned on the `augmxnt/shisa-pretrain-en-ja-v1` dataset. The model has been trained on 5.5 billion tokens, offering a robust performance for various natural language processing (NLP) tasks.
|
5 |
+
|
6 |
+
## Model Overview
|
7 |
+
|
8 |
+
- **Base Model**: TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T
|
9 |
+
- **Training Dataset**: augmxnt/shisa-pretrain-en-ja-v1
|
10 |
+
- **Training Tokens**: 5.5 billion
|
11 |
+
|
12 |
+
This model is designed for a range of NLP tasks, including but not limited to language translation, text generation, and sentiment analysis. It is particularly effective in handling bilingual content in English and Japanese.
|
13 |
+
|
14 |
+
## Usage
|
15 |
+
|
16 |
+
### Installation
|
17 |
+
|
18 |
+
To use this model, you'll need to install the `transformers` library from Hugging Face:
|
19 |
+
|
20 |
+
```bash
|
21 |
+
pip install transformers
|
22 |
+
```
|
23 |
+
|
24 |
+
### Loading the Model
|
25 |
+
|
26 |
+
You can load the model using the `transformers` library as follows:
|
27 |
+
|
28 |
+
```python
|
29 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
30 |
+
|
31 |
+
model_name = "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T"
|
32 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
33 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
34 |
+
```
|
35 |
+
|
36 |
+
### Generating Text
|
37 |
+
|
38 |
+
Here is an example of how to generate text using the loaded model:
|
39 |
+
|
40 |
+
```python
|
41 |
+
input_text = "Translate the following English text to Japanese: Hello, how are you?"
|
42 |
+
input_ids = tokenizer.encode(input_text, return_tensors='pt')
|
43 |
+
|
44 |
+
# Generate text
|
45 |
+
outputs = model.generate(input_ids, max_length=50, num_return_sequences=1)
|
46 |
+
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
47 |
+
|
48 |
+
print(generated_text)
|
49 |
+
```
|
50 |
+
|
51 |
+
## Model Performance
|
52 |
+
|
53 |
+
This model has been trained on a diverse dataset to ensure high performance across various tasks. Below are some benchmark results:
|
54 |
+
|
55 |
+
- **Language Translation**: Achieves high accuracy in translating between English and Japanese.
|
56 |
+
- **Text Generation**: Produces coherent and contextually relevant text for prompts in both languages.
|
57 |
+
- **Sentiment Analysis**: Effectively classifies sentiments with a high degree of accuracy.
|
58 |
+
|
59 |
+
## Fine-Tuning
|
60 |
+
|
61 |
+
For users interested in fine-tuning this model on their own datasets, the following code snippet provides a starting point:
|
62 |
+
|
63 |
+
```python
|
64 |
+
from transformers import Trainer, TrainingArguments
|
65 |
+
|
66 |
+
training_args = TrainingArguments(
|
67 |
+
output_dir='./results',
|
68 |
+
num_train_epochs=3,
|
69 |
+
per_device_train_batch_size=4,
|
70 |
+
save_steps=10_000,
|
71 |
+
save_total_limit=2,
|
72 |
+
)
|
73 |
+
|
74 |
+
trainer = Trainer(
|
75 |
+
model=model,
|
76 |
+
args=training_args,
|
77 |
+
train_dataset=my_train_dataset,
|
78 |
+
eval_dataset=my_eval_dataset,
|
79 |
+
)
|
80 |
+
|
81 |
+
trainer.train()
|
82 |
+
```
|
83 |
+
|
84 |
+
Replace `my_train_dataset` and `my_eval_dataset` with your own dataset objects.
|
85 |
+
|
86 |
+
## Acknowledgements
|
87 |
+
|
88 |
+
This model was built upon the work of the TinyLlama project and trained using the `augmxnt/shisa-pretrain-en-ja-v1` dataset. We acknowledge their contributions to the NLP community.
|
89 |
+
|
90 |
+
## License
|
91 |
+
|
92 |
+
This model is released under the [MIT License](LICENSE).
|
93 |
+
|
94 |
+
## Contact
|
95 |
+
|
96 |
+
For questions or feedback, please open an issue in this repository or contact us at [[email protected]].
|
axolotl_config_qrwpz281.yml
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
base_model: TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T
|
2 |
+
model_type: LlamaForCausalLM
|
3 |
+
tokenizer_type: AutoTokenizer
|
4 |
+
|
5 |
+
load_in_8bit: false
|
6 |
+
load_in_4bit: false
|
7 |
+
strict: false
|
8 |
+
|
9 |
+
pretraining_dataset:
|
10 |
+
- path: augmxnt/shisa-pretrain-en-ja-v1
|
11 |
+
type: completion
|
12 |
+
|
13 |
+
total_supervised_tokens: true
|
14 |
+
pretrain_multipack_attn: false
|
15 |
+
dataset_processes: 32
|
16 |
+
val_set_size: 0.0
|
17 |
+
output_dir: ./out
|
18 |
+
pretrain_multipack_buffer_size: 100000
|
19 |
+
max_steps: 4702818
|
20 |
+
|
21 |
+
sequence_len: 2048
|
22 |
+
sample_packing: true
|
23 |
+
pad_to_sequence_len: true
|
24 |
+
eval_sample_packing: false
|
25 |
+
|
26 |
+
adapter:
|
27 |
+
lora_model_dir:
|
28 |
+
lora_r:
|
29 |
+
lora_alpha:
|
30 |
+
lora_dropout:
|
31 |
+
lora_target_linear:
|
32 |
+
lora_fan_in_fan_out:
|
33 |
+
|
34 |
+
wandb_project: tiny-llama
|
35 |
+
wandb_entity:
|
36 |
+
wandb_watch:
|
37 |
+
wandb_name:
|
38 |
+
wandb_log_model:
|
39 |
+
|
40 |
+
gradient_accumulation_steps: 64
|
41 |
+
micro_batch_size: 1
|
42 |
+
num_epochs: 1
|
43 |
+
optimizer: adamw_apex_fused
|
44 |
+
lr_scheduler: cosine
|
45 |
+
learning_rate: 5e-5
|
46 |
+
adam_beta1: 0.9
|
47 |
+
adam_beta2: 0.95
|
48 |
+
|
49 |
+
train_on_inputs: false
|
50 |
+
group_by_length: false
|
51 |
+
bf16: true
|
52 |
+
fp16: false
|
53 |
+
tf32: false
|
54 |
+
|
55 |
+
gradient_checkpointing: false
|
56 |
+
early_stopping_patience:
|
57 |
+
resume_from_checkpoint:
|
58 |
+
auto_resume_from_checkpoints:
|
59 |
+
logging_steps: 1
|
60 |
+
xformers_attention:
|
61 |
+
flash_attention: true
|
62 |
+
flash_attn_cross_entropy: false
|
63 |
+
flash_attn_rms_norm: true
|
64 |
+
flash_attn_fuse_qkv: false
|
65 |
+
flash_attn_fuse_mlp: true
|
66 |
+
|
67 |
+
save_total_limit: 15
|
68 |
+
warmup_steps: 100
|
69 |
+
evals_per_epoch:
|
70 |
+
eval_table_size:
|
71 |
+
save_steps: 250
|
72 |
+
saves_per_epoch:
|
73 |
+
debug:
|
74 |
+
deepspeed: deepspeed_configs/zero1.json
|
75 |
+
weight_decay: 0.1
|
76 |
+
fsdp:
|
77 |
+
fsdp_config:
|
78 |
+
special_tokens:
|