Aigis commited on
Commit
3f94e82
·
1 Parent(s): d907d60

Added Models.

Browse files
Files changed (8) hide show
  1. Inferencecode.py +35 -0
  2. README.md +87 -0
  3. UUFO.png +0 -0
  4. config.json +24 -0
  5. model.safetensors +3 -0
  6. tokenizer.json +0 -0
  7. tokenizer.model +3 -0
  8. tokenizer_config.json +42 -0
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-100M" #Replace 100M with 250M or 500M 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,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pico-OpenLAiNN-100M 🤗
2
+
3
+ Hey there fellow researchers, developers, and AI enthusiasts! Today I'm releasing the full version of Pico-OpenLAiNN-100M, I had previously released a version before this that was trained on only 8B tokens. This LLM was trained on the full 32B tokens that the entire Open-PicoLAiNN family is trained on.
4
+
5
+ You can find the GGUF quants of this model [here](https://huggingface.co/UUFO-Aigis/Pico-OpenLAiNN-100M-gguf).
6
+ ## Models Overview
7
+
8
+ - **Pico-OpenLAiNN-100**: The smallest of the bunch, this 100M parameter model is perfect for quick experiments and applications where computational resources are *extremely* limited.
9
+ - **Pico-OpenLAiNN-250**: This is the middle child of the PicoLAiNN family, it's still tiny at 250M parameters but is more capable than the 100M parameter model.
10
+ - **Pico-OpenLAiNN-500**: My current "Heavyweight" Model, this model has 500M parameters and is the most capable of the Pico-OpenLAiNN models.
11
+ ## Pretraining Details
12
+
13
+ This specific version of Pico LAiNN was trained on just 32B tokens of the fineweb dataset.
14
+
15
+ ## Other information:
16
+
17
+ - **Compatibility**: Built to be compatible with existing projects that use LLAMA 2's tokenizer and architecture.
18
+ - **Ease of Use**: No need to reinvent the wheel. These models are ready to be plugged into your applications.
19
+ - **Open Source**: Fully open source, so you can tweak, tune, and twist them to your heart's content.
20
+ ## Getting Started
21
+
22
+ To start using these models, you can simply load them via the Hugging Face `transformers` library:
23
+
24
+ ```python
25
+ import torch
26
+ from transformers import AutoModelForCausalLM, AutoTokenizer
27
+
28
+
29
+ MODEL_NAME = "UUFO-Aigis/Pico-OpenLAiNN-100M" #Replace 100M with 250M or 500M if you prefer those models.
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
32
+ model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
33
+
34
+ def generate_text(prompt, model, tokenizer, max_length=512, temperature=1, top_k=50, top_p=0.95):
35
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
36
+
37
+ outputs = model.generate(
38
+ inputs,
39
+ max_length=max_length,
40
+ temperature=temperature,
41
+ top_k=top_k,
42
+ top_p=top_p,
43
+ do_sample=True
44
+ )
45
+
46
+
47
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
48
+ return generated_text
49
+
50
+ def main():
51
+ # Define your prompt
52
+ prompt = "According to all known laws of aviation, there is no way a bee should be able to fly."
53
+
54
+ generated_text = generate_text(prompt, model, tokenizer)
55
+
56
+ print(generated_text)
57
+
58
+ if __name__ == "__main__":
59
+ main()
60
+ ```
61
+ # Benchy :3
62
+
63
+ | Tasks | Value | |Stderr|
64
+ |--------------|------:|---|-----:|
65
+ |arc_challenge | 0.1826|± |0.0113|
66
+ |arc_easy | 0.4007|± |0.0101|
67
+ |boolq | 0.6012|± |0.0086|
68
+ |hellaswag | 0.2936|± |0.0045|
69
+ |lambada_openai| 0.2701|± |0.0062|
70
+ |piqa | 0.6338|± |0.0112|
71
+ |winogrande | 0.5099|± |0.0140|
72
+
73
+ ## Future Plans
74
+
75
+ - **More Models**: I'm currenetly training the bigger siblings of this models, including a 1B parameter version and beyond. 2-4 Billion parameter versions are planned. These will be Released as OpenLAiNN.
76
+ - **New architecture**: This is still up in the air and I'm still developing it, and will release if I deem it to be actually useful, so stay tuned, this will likely be named FLaRE-LAiNN.
77
+ - **Paper**: A detailed paper made available for those interested in the details.
78
+
79
+ ## Credit Where Credit's Due
80
+
81
+ 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. Thanks 🤗
82
+ ## Contact
83
+ If you have questions, Please reach out to me at urlsys32dll@gmail.com
84
+
85
+ <p align="center">
86
+ <img src="UUFO.png" alt="U.U.F.O Research Logo" width="250"/>
87
+ </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": 768,
9
+ "initializer_range": 0.02,
10
+ "intermediate_size": 2048,
11
+ "max_position_embeddings": 2048,
12
+ "model_type": "llama",
13
+ "num_attention_heads": 8,
14
+ "num_hidden_layers": 9,
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:a4c70d33d48d95eb670045f7ceb066f6f373c5bbfea91072e7aedd13a93f5b3e
3
+ size 207164992
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
+ }