luelhagos
commited on
Commit
•
fb95af7
1
Parent(s):
7a3bc4a
Initial commit
Browse files- added_tokens.json +3 -0
- config.json +33 -0
- generation_config.json +7 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- readme.md +41 -0
- special_tokens_map.json +24 -0
- tokenizer.json +0 -0
- tokenizer_config.json +33 -0
- training_args.bin +3 -0
- vocab.json +0 -0
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|endoftext|>": 16000
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation_function": "gelu_new",
|
3 |
+
"architectures": [
|
4 |
+
"GPT2LMHeadModel"
|
5 |
+
],
|
6 |
+
"attn_pdrop": 0.1,
|
7 |
+
"bos_token_id": 16000,
|
8 |
+
"embd_pdrop": 0.1,
|
9 |
+
"eos_token_id": 16000,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"layer_norm_epsilon": 1e-05,
|
12 |
+
"model_type": "gpt2",
|
13 |
+
"n_ctx": 128,
|
14 |
+
"n_embd": 384,
|
15 |
+
"n_head": 6,
|
16 |
+
"n_inner": null,
|
17 |
+
"n_layer": 6,
|
18 |
+
"n_positions": 128,
|
19 |
+
"pad_token_id": 16000,
|
20 |
+
"reorder_and_upcast_attn": false,
|
21 |
+
"resid_pdrop": 0.1,
|
22 |
+
"scale_attn_by_inverse_layer_idx": false,
|
23 |
+
"scale_attn_weights": true,
|
24 |
+
"summary_activation": null,
|
25 |
+
"summary_first_dropout": 0.1,
|
26 |
+
"summary_proj_to_labels": true,
|
27 |
+
"summary_type": "cls_index",
|
28 |
+
"summary_use_proj": true,
|
29 |
+
"torch_dtype": "float32",
|
30 |
+
"transformers_version": "4.31.0",
|
31 |
+
"use_cache": true,
|
32 |
+
"vocab_size": 16000
|
33 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 16000,
|
4 |
+
"eos_token_id": 16000,
|
5 |
+
"pad_token_id": 16000,
|
6 |
+
"transformers_version": "4.31.0"
|
7 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44acda5fc5c4f11c4676483c2b3f6b69af2dad5a12dab0caf65b18e1859c42cd
|
3 |
+
size 67387730
|
readme.md
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
language: ti
|
2 |
+
tags:
|
3 |
+
- tigrinya
|
4 |
+
- gpt2
|
5 |
+
- text-generation
|
6 |
+
---
|
7 |
+
|
8 |
+
# GPT-2 for Tigrinya Language
|
9 |
+
|
10 |
+
This repository contains a GPT-2 model trained from scratch on Tigrinya text data. The model was trained using the Hugging Face Transformers library.
|
11 |
+
|
12 |
+
## Model Details
|
13 |
+
|
14 |
+
- Model Type: GPT-2
|
15 |
+
- Language: Tigrinya
|
16 |
+
- Vocabulary Size: 16000
|
17 |
+
- Maximum Length: 128
|
18 |
+
- Model Size: Small
|
19 |
+
- Number of Parameters: 33,523,200
|
20 |
+
|
21 |
+
## Training Details
|
22 |
+
|
23 |
+
- Number of Epochs: 12
|
24 |
+
- Batch Size: 1 (with gradient accumulation steps of 4)
|
25 |
+
- Learning Rate: 5e-4
|
26 |
+
|
27 |
+
## Dataset Statistics
|
28 |
+
- Total number of words: 16061839
|
29 |
+
- Total number of unique words: 458901
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
|
33 |
+
```python
|
34 |
+
from transformers import pipeline
|
35 |
+
|
36 |
+
# Load the model
|
37 |
+
generator = pipeline('text-generation', model='luel/gpt2-tigrinya-small')
|
38 |
+
|
39 |
+
# Generate text
|
40 |
+
text = generator("ትግራይ", max_length=60)
|
41 |
+
print(text)
|
special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|endoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<|endoftext|>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<|endoftext|>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_prefix_space": false,
|
4 |
+
"bos_token": {
|
5 |
+
"__type": "AddedToken",
|
6 |
+
"content": "<|endoftext|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"clean_up_tokenization_spaces": true,
|
13 |
+
"eos_token": {
|
14 |
+
"__type": "AddedToken",
|
15 |
+
"content": "<|endoftext|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": true,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"errors": "replace",
|
22 |
+
"model_max_length": 1000000000000000019884624838656,
|
23 |
+
"pad_token": null,
|
24 |
+
"tokenizer_class": "GPT2Tokenizer",
|
25 |
+
"unk_token": {
|
26 |
+
"__type": "AddedToken",
|
27 |
+
"content": "<|endoftext|>",
|
28 |
+
"lstrip": false,
|
29 |
+
"normalized": true,
|
30 |
+
"rstrip": false,
|
31 |
+
"single_word": false
|
32 |
+
}
|
33 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3777a317bf341e421d34ab5c85e2f26e4745322ade7e92ac2ba07678fd929786
|
3 |
+
size 4344
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|