Text Generation
Transformers
English
llama
Inference Endpoints
LoneStriker commited on
Commit
29901b1
1 Parent(s): b2a2fae

ExLLaMA V2 quant of TinyLlama-1.1B-Chat-v0.3-8.0bpw-h8-exl2

Browse files
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - cerebras/SlimPajama-627B
5
+ - bigcode/starcoderdata
6
+ - OpenAssistant/oasst_top1_2023-08-25
7
+ language:
8
+ - en
9
+ ---
10
+ <div align="center">
11
+
12
+ # TinyLlama-1.1B
13
+ </div>
14
+
15
+ https://github.com/jzhang38/TinyLlama
16
+
17
+ The TinyLlama project aims to **pretrain** a **1.1B Llama model on 3 trillion tokens**. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.
18
+
19
+
20
+ We adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.
21
+
22
+ #### This Model
23
+ This is the chat model finetuned on top of [PY007/TinyLlama-1.1B-intermediate-step-480k-1T](https://huggingface.co/PY007/TinyLlama-1.1B-intermediate-step-480k-1T).
24
+ The dataset used is [OpenAssistant/oasst_top1_2023-08-25](https://huggingface.co/datasets/OpenAssistant/oasst_top1_2023-08-25) following the [chatml](https://github.com/openai/openai-python/blob/main/chatml.md) format.
25
+ #### How to use
26
+ You will need the transformers>=4.31
27
+ Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.
28
+ ```
29
+ from transformers import AutoTokenizer
30
+ import transformers
31
+ import torch
32
+ model = "PY007/TinyLlama-1.1B-Chat-v0.3"
33
+ tokenizer = AutoTokenizer.from_pretrained(model)
34
+ pipeline = transformers.pipeline(
35
+ "text-generation",
36
+ model=model,
37
+ torch_dtype=torch.float16,
38
+ device_map="auto",
39
+ )
40
+
41
+ CHAT_EOS_TOKEN_ID = 32002
42
+
43
+ prompt = "How to get in a good university?"
44
+ formatted_prompt = (
45
+ f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
46
+ )
47
+
48
+
49
+ sequences = pipeline(
50
+ formatted_prompt,
51
+ do_sample=True,
52
+ top_k=50,
53
+ top_p = 0.9,
54
+ num_return_sequences=1,
55
+ repetition_penalty=1.1,
56
+ max_new_tokens=1024,
57
+ eos_token_id=CHAT_EOS_TOKEN_ID,
58
+ )
59
+
60
+ for seq in sequences:
61
+ print(f"Result: {seq['generated_text']}")
62
+ ```
added_tokens.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "<|im_end|>": 32002,
3
+ "<|im_start|>": 32001,
4
+ "[PAD]": 32000
5
+ }
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "TinyLlama/sft/output/503B_FT_lr1e-5_ep5_top1_2023-08-25/checkpoint-3890",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 5632,
13
+ "max_position_embeddings": 2048,
14
+ "model_type": "llama",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 22,
17
+ "num_key_value_heads": 4,
18
+ "pretraining_tp": 1,
19
+ "rms_norm_eps": 1e-05,
20
+ "rope_scaling": null,
21
+ "rope_theta": 10000.0,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "float32",
24
+ "transformers_version": "4.34.0.dev0",
25
+ "use_cache": false,
26
+ "vocab_size": 32003
27
+ }
generation_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_new_tokens": 32,
3
+ "transformers_version": "4.34.0.dev0"
4
+ }
output.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4aeec6384d37ba4a154e93845070b988eef86eab2fdc55b8b44ab3657d5dbc9
3
+ size 1167896952
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "pad_token": "[PAD]",
5
+ "unk_token": "<unk>"
6
+ }
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,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<unk>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<s>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "32000": {
28
+ "content": "[PAD]",
29
+ "lstrip": true,
30
+ "normalized": false,
31
+ "rstrip": true,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "32001": {
36
+ "content": "<|im_start|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "32002": {
44
+ "content": "<|im_end|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ }
51
+ },
52
+ "additional_special_tokens": [],
53
+ "bos_token": "<s>",
54
+ "clean_up_tokenization_spaces": false,
55
+ "eos_token": "</s>",
56
+ "legacy": false,
57
+ "model_max_length": 1000000000000000019884624838656,
58
+ "pad_token": "[PAD]",
59
+ "padding_side": "right",
60
+ "sp_model_kwargs": {},
61
+ "tokenizer_class": "LlamaTokenizer",
62
+ "unk_token": "<unk>",
63
+ "use_default_system_prompt": true
64
+ }