HXCR commited on
Commit
2085301
1 Parent(s): b974e52

Upload 8 files

Browse files
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Model Card for Custom Minimal Transformer
2
+
3
+ ### Model Description
4
+ This is a custom transformer model designed for educational purposes. It demonstrates the basic structure of a transformer model using PyTorch and integrates a pre-trained tokenizer from the Hugging Face library (`bert-base-uncased`).
5
+
6
+ ### Architecture
7
+ The model, `MinimalTransformer`, is a simplified transformer architecture consisting of:
8
+ - Multi-head attention mechanism (`nn.MultiheadAttention`).
9
+ - Layer normalization (`nn.LayerNorm`).
10
+ - A feed-forward network composed of linear layers and ReLU activation.
11
+
12
+ It demonstrates basic transformer concepts while being more lightweight and easier to understand than full-scale models like BERT or GPT.
13
+
14
+ ### Training
15
+ The model was trained on a small, manually created dataset consisting of simple sentences like "Hello world", "Transformers are great", and "PyTorch is fun". It's intended for basic demonstrations and not for achieving state-of-the-art results on complex tasks.
16
+
17
+ ### Tokenizer
18
+ The tokenizer used is the `AutoTokenizer` from Hugging Face, specifically the "bert-base-uncased" variant. It handles tokenization, adding special tokens, and converting tokens to their respective IDs in the BERT vocabulary.
19
+
20
+ ### Usage
21
+ The model can be used for basic NLP tasks and demonstrations. To use the model:
22
+ - Load the saved model weights into the `MinimalTransformer` architecture.
23
+ - Tokenize input sentences using the provided tokenizer.
24
+ - Pass the tokenized input through the model for inference.
25
+
26
+ ### Limitations and Bias
27
+ - The model's performance is limited due to its simplistic nature and the small training dataset.
28
+ - As it uses a pre-trained BERT tokenizer, any biases present in the BERT model may be transferred to this model.
29
+
30
+ ### Acknowledgements
31
+ This model was created for educational purposes and is based on the PyTorch and Hugging Face Transformers libraries.
config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "embed_size": 128,
3
+ "heads": 8,
4
+ "forward_expansion": 4,
5
+ "vocab_size": 30522
6
+ }
hello-base-model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:737d22f5b6d2744c80701cf77eb34483aea0fbbbacbc23c8cdbf9c3090c6176a
3
+ size 15630675
hello-base-model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaf1093f724078b0c5ab96952e303e8ced11bae36eaf72143ba9750092a6dc2d
3
+ size 15629052
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "mask_token": "[MASK]",
48
+ "model_max_length": 512,
49
+ "pad_token": "[PAD]",
50
+ "sep_token": "[SEP]",
51
+ "strip_accents": null,
52
+ "tokenize_chinese_chars": true,
53
+ "tokenizer_class": "BertTokenizer",
54
+ "unk_token": "[UNK]"
55
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff