Aigis commited on
Commit
a1dc9d8
1 Parent(s): a4a159a

Added model files

Browse files
Inferencecode.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from transformers import AutoModelForCausalLM, AutoTokenizer
3
+
4
+
5
+ MODEL_NAME = "UUFO-Aigis/Pico-OpenLAiNN-10M" #Replace 10M with 25M, 50M or 75M if you prefer those models.
6
+
7
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
8
+ model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
9
+
10
+ def generate_text(prompt, model, tokenizer, max_length=512, temperature=1, top_k=50, top_p=0.95):
11
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
12
+
13
+ outputs = model.generate(
14
+ inputs,
15
+ max_length=max_length,
16
+ temperature=temperature,
17
+ top_k=top_k,
18
+ top_p=top_p,
19
+ do_sample=True
20
+ )
21
+
22
+
23
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
24
+ return generated_text
25
+
26
+ def main():
27
+ # Define your prompt
28
+ prompt = "According to all known laws of aviation, there is no way a bee should be able to fly."
29
+
30
+ generated_text = generate_text(prompt, model, tokenizer)
31
+
32
+ print(generated_text)
33
+
34
+ if __name__ == "__main__":
35
+ main()
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Planck-OpenLAiNN 🤗
2
+
3
+ Hey there fellow researchers, developers, and AI enthusiasts! Today I'm releasing a new family of Models, Planck LAiNN, These are probably some of the smallest LLMs that are on HF. They aren't super useful but it was a fun expierment!~
4
+ ## Models Overview
5
+ - **Panck-OpenLAiNN-10M**: A Truely Tiny model with just 10 Million parameters, this is probably boarderline useless, but it *IS* functional.
6
+ - **Panck-OpenLAiNN-25M**: The second smallest model, 25 million parameters, it's not that much better.
7
+ - **Panck-OpenLAiNN-50M**: Surprisingly smart, it's 50 Million parameters and could potentially maybe, Possibly even be useful ;)
8
+ - **Panck-OpenLAiNN-75M**: The current *""heavy""* weight of the Plank-OpenLAiNN Models.
9
+ ## Pretraining Details
10
+
11
+ Plank-OpenLAiNN was trained on 32B tokens of the Fineweb dataset, it's the same one that was used for the Pico-LAiNN family of models. The model was pretrained with a context length of 1024 tokens.
12
+
13
+ ## Other information:
14
+
15
+ - **Compatibility**: Built to be compatible with existing projects that use LLAMA 2's tokenizer and architecture.
16
+ - **Ease of Use**: No need to reinvent the wheel. These models are ready to be plugged into your applications.
17
+ - **Open Source**: Fully open source, so you can tweak, tune, and twist them to your heart's content.
18
+ ## Getting Started
19
+
20
+ To start using these models, you can simply load them via the Hugging Face `transformers` library:
21
+
22
+ ```python
23
+ import torch
24
+ from transformers import AutoModelForCausalLM, AutoTokenizer
25
+
26
+
27
+ MODEL_NAME = "UUFO-Aigis/Panck-OpenLAiNN-10M"
28
+
29
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
30
+ model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
31
+
32
+ def generate_text(prompt, model, tokenizer, max_length=512, temperature=1, top_k=50, top_p=0.95):
33
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
34
+
35
+ outputs = model.generate(
36
+ inputs,
37
+ max_length=max_length,
38
+ temperature=temperature,
39
+ top_k=top_k,
40
+ top_p=top_p,
41
+ do_sample=True
42
+ )
43
+
44
+
45
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
46
+ return generated_text
47
+
48
+ def main():
49
+ # Define your prompt
50
+ prompt = "According to all known laws of aviation, there is no way a bee should be able to fly."
51
+
52
+ generated_text = generate_text(prompt, model, tokenizer)
53
+
54
+ print(generated_text)
55
+
56
+ if __name__ == "__main__":
57
+ main()
58
+ ```
59
+ # Benchy
60
+
61
+ | Tasks | Value | |Stderr|
62
+ |--------------|------:|---|-----:|
63
+ |arc_challenge | 0.1766|± |0.0111|
64
+ |arc_easy | 0.3144|± |0.0095|
65
+ |boolq | 0.5847|± |0.0086|
66
+ |hellaswag | 0.2622|± |0.0044|
67
+ |lambada_openai| 0.0047|± |0.0009| # Yes, really
68
+ |piqa | 0.5718|± |0.0115|
69
+ |winogrande | 0.4957|± |0.0141|
70
+
71
+ ## Future Plans
72
+
73
+ - **More Models**: I'm currenetly training the bigger siblings of Pico-OpenLAiNN, including a 1B parameter version and beyond. 2-4 Billion parameter versions are planned. These will be Released as OpenLAiNN.
74
+ - **New architecture**: This is still up in the air and I'm still developing it, things are going well and I'll post updates.
75
+ - **Paper**: A detailed paper or training data will be posted at some point.
76
+
77
+ ## Credit Where Credit's Due
78
+
79
+ If you find these models useful and decide to use these models, a link to this repository would be highly appreciated. I am a one man show running this and I'm doing this for free, Thanks 🤗
80
+ ## Contact
81
+ If you have questions, Please reach out to me at [email protected]
82
+
83
+ <p align="center">
84
+ <img src="UUFO.png" alt="U.U.F.O Research Logo" width="250"/>
85
+ </p>
UUFO.png ADDED
config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "bos_token_id": 1,
6
+ "eos_token_id": 2,
7
+ "hidden_act": "silu",
8
+ "hidden_size": 192,
9
+ "initializer_range": 0.02,
10
+ "intermediate_size": 1024,
11
+ "max_position_embeddings": 1024,
12
+ "model_type": "llama",
13
+ "num_attention_heads": 2,
14
+ "num_hidden_layers": 1,
15
+ "num_key_value_heads": 1,
16
+ "pretraining_tp": 1,
17
+ "rms_norm_eps": 1e-05,
18
+ "rope_scaling": null,
19
+ "tie_word_embeddings": false,
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.31.0.dev0",
22
+ "use_cache": true,
23
+ "vocab_size": 32000
24
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7198d242c2903a94acc187bbaaf864637f4af8890b13b220fdf4e4af99590628
3
+ size 25979272
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": true,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": true,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": true,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "legacy": true,
35
+ "model_max_length": 2048,
36
+ "pad_token": null,
37
+ "sp_model_kwargs": {},
38
+ "spaces_between_special_tokens": false,
39
+ "tokenizer_class": "LlamaTokenizer",
40
+ "unk_token": "<unk>",
41
+ "use_default_system_prompt": false
42
+ }