jaypinedabengco
commited on
Commit
•
1ab3e62
1
Parent(s):
2a6b0b6
Add model
Browse files- .gitignore +1 -0
- added_tokens.json +3 -0
- config.json +28 -0
- model.safetensors +3 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +20 -0
- tokenizer.json +0 -0
- tokenizer_config.json +83 -0
- train.ipynb +137 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.ipynb_checkpoints
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<unk>NOTUSED": 32005
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "camembert-base",
|
3 |
+
"architectures": [
|
4 |
+
"CamembertForMaskedLM"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 5,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 6,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 514,
|
17 |
+
"model_type": "camembert",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"output_past": true,
|
21 |
+
"pad_token_id": 1,
|
22 |
+
"position_embedding_type": "absolute",
|
23 |
+
"torch_dtype": "float32",
|
24 |
+
"transformers_version": "4.39.3",
|
25 |
+
"type_vocab_size": 1,
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 32005
|
28 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2785d2e45752c5c93021cd3277207734dee67409ca1c6c98da4f6b9d709a5cec
|
3 |
+
size 442646188
|
sentencepiece.bpe.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:988bc5a00281c6d210a5d34bd143d0363741a432fefe741bf71e61b1869d4314
|
3 |
+
size 810912
|
special_tokens_map.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<s>NOTUSED",
|
4 |
+
"</s>NOTUSED",
|
5 |
+
"<unk>NOTUSED"
|
6 |
+
],
|
7 |
+
"bos_token": "<s>",
|
8 |
+
"cls_token": "<s>",
|
9 |
+
"eos_token": "</s>",
|
10 |
+
"mask_token": {
|
11 |
+
"content": "<mask>",
|
12 |
+
"lstrip": true,
|
13 |
+
"normalized": false,
|
14 |
+
"rstrip": false,
|
15 |
+
"single_word": false
|
16 |
+
},
|
17 |
+
"pad_token": "<pad>",
|
18 |
+
"sep_token": "</s>",
|
19 |
+
"unk_token": "<unk>"
|
20 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>NOTUSED",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>NOTUSED",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"4": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"5": {
|
36 |
+
"content": "<s>",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"6": {
|
44 |
+
"content": "</s>",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"32004": {
|
52 |
+
"content": "<mask>",
|
53 |
+
"lstrip": true,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"32005": {
|
60 |
+
"content": "<unk>NOTUSED",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
}
|
67 |
+
},
|
68 |
+
"additional_special_tokens": [
|
69 |
+
"<s>NOTUSED",
|
70 |
+
"</s>NOTUSED",
|
71 |
+
"<unk>NOTUSED"
|
72 |
+
],
|
73 |
+
"bos_token": "<s>",
|
74 |
+
"clean_up_tokenization_spaces": true,
|
75 |
+
"cls_token": "<s>",
|
76 |
+
"eos_token": "</s>",
|
77 |
+
"mask_token": "<mask>",
|
78 |
+
"model_max_length": 512,
|
79 |
+
"pad_token": "<pad>",
|
80 |
+
"sep_token": "</s>",
|
81 |
+
"tokenizer_class": "CamembertTokenizer",
|
82 |
+
"unk_token": "<unk>"
|
83 |
+
}
|
train.ipynb
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 2,
|
6 |
+
"id": "a59aaa09",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [
|
9 |
+
{
|
10 |
+
"data": {
|
11 |
+
"application/vnd.jupyter.widget-view+json": {
|
12 |
+
"model_id": "dd105016112541b194045b128689cfe5",
|
13 |
+
"version_major": 2,
|
14 |
+
"version_minor": 0
|
15 |
+
},
|
16 |
+
"text/plain": [
|
17 |
+
"model.safetensors: 0%| | 0.00/445M [00:00<?, ?B/s]"
|
18 |
+
]
|
19 |
+
},
|
20 |
+
"metadata": {},
|
21 |
+
"output_type": "display_data"
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"name": "stderr",
|
25 |
+
"output_type": "stream",
|
26 |
+
"text": [
|
27 |
+
"Some weights of the model checkpoint at camembert-base were not used when initializing CamembertForMaskedLM: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']\n",
|
28 |
+
"- This IS expected if you are initializing CamembertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
|
29 |
+
"- This IS NOT expected if you are initializing CamembertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
|
30 |
+
]
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"data": {
|
34 |
+
"application/vnd.jupyter.widget-view+json": {
|
35 |
+
"model_id": "4f5386b083da4339b401dd252266681b",
|
36 |
+
"version_major": 2,
|
37 |
+
"version_minor": 0
|
38 |
+
},
|
39 |
+
"text/plain": [
|
40 |
+
"tokenizer_config.json: 0%| | 0.00/25.0 [00:00<?, ?B/s]"
|
41 |
+
]
|
42 |
+
},
|
43 |
+
"metadata": {},
|
44 |
+
"output_type": "display_data"
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"data": {
|
48 |
+
"application/vnd.jupyter.widget-view+json": {
|
49 |
+
"model_id": "21bbb7e42ed54de98afc7c476a8b5082",
|
50 |
+
"version_major": 2,
|
51 |
+
"version_minor": 0
|
52 |
+
},
|
53 |
+
"text/plain": [
|
54 |
+
"sentencepiece.bpe.model: 0%| | 0.00/811k [00:00<?, ?B/s]"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
"metadata": {},
|
58 |
+
"output_type": "display_data"
|
59 |
+
},
|
60 |
+
{
|
61 |
+
"data": {
|
62 |
+
"application/vnd.jupyter.widget-view+json": {
|
63 |
+
"model_id": "656b2934e5fe42f1958df0d6ecbb7d38",
|
64 |
+
"version_major": 2,
|
65 |
+
"version_minor": 0
|
66 |
+
},
|
67 |
+
"text/plain": [
|
68 |
+
"tokenizer.json: 0%| | 0.00/1.40M [00:00<?, ?B/s]"
|
69 |
+
]
|
70 |
+
},
|
71 |
+
"metadata": {},
|
72 |
+
"output_type": "display_data"
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"data": {
|
76 |
+
"text/plain": [
|
77 |
+
"('./tokenizer_config.json',\n",
|
78 |
+
" './special_tokens_map.json',\n",
|
79 |
+
" './sentencepiece.bpe.model',\n",
|
80 |
+
" './added_tokens.json',\n",
|
81 |
+
" './tokenizer.json')"
|
82 |
+
]
|
83 |
+
},
|
84 |
+
"execution_count": 2,
|
85 |
+
"metadata": {},
|
86 |
+
"output_type": "execute_result"
|
87 |
+
}
|
88 |
+
],
|
89 |
+
"source": [
|
90 |
+
"from transformers import AutoModelForMaskedLM, AutoTokenizer\n",
|
91 |
+
"\n",
|
92 |
+
"checkpoint = \"camembert-base\"\n",
|
93 |
+
"\n",
|
94 |
+
"model = AutoModelForMaskedLM.from_pretrained(checkpoint)\n",
|
95 |
+
"tokenizer = AutoTokenizer.from_pretrained(checkpoint)\n",
|
96 |
+
"\n",
|
97 |
+
"\n",
|
98 |
+
"model.save_pretrained(\".\")\n",
|
99 |
+
"tokenizer.save_pretrained(\".\")"
|
100 |
+
]
|
101 |
+
}
|
102 |
+
],
|
103 |
+
"metadata": {
|
104 |
+
"kernelspec": {
|
105 |
+
"display_name": "Python 3 (ipykernel)",
|
106 |
+
"language": "python",
|
107 |
+
"name": "python3"
|
108 |
+
},
|
109 |
+
"language_info": {
|
110 |
+
"codemirror_mode": {
|
111 |
+
"name": "ipython",
|
112 |
+
"version": 3
|
113 |
+
},
|
114 |
+
"file_extension": ".py",
|
115 |
+
"mimetype": "text/x-python",
|
116 |
+
"name": "python",
|
117 |
+
"nbconvert_exporter": "python",
|
118 |
+
"pygments_lexer": "ipython3",
|
119 |
+
"version": "3.11.6"
|
120 |
+
},
|
121 |
+
"toc": {
|
122 |
+
"base_numbering": 1,
|
123 |
+
"nav_menu": {},
|
124 |
+
"number_sections": true,
|
125 |
+
"sideBar": true,
|
126 |
+
"skip_h1_title": false,
|
127 |
+
"title_cell": "Table of Contents",
|
128 |
+
"title_sidebar": "Contents",
|
129 |
+
"toc_cell": false,
|
130 |
+
"toc_position": {},
|
131 |
+
"toc_section_display": true,
|
132 |
+
"toc_window_display": false
|
133 |
+
}
|
134 |
+
},
|
135 |
+
"nbformat": 4,
|
136 |
+
"nbformat_minor": 5
|
137 |
+
}
|