SE6446 commited on
Commit
8ca2f4a
·
verified ·
1 Parent(s): 7a8b105

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ widget:
4
+ - text: >
5
+ <|system|>
6
+
7
+ You are a chatbot who can help code!</s>
8
+
9
+ <|user|>
10
+
11
+ Write me a function to calculate the first 10 digits of the fibonacci
12
+ sequence in Python and print it out to the CLI.</s>
13
+
14
+ <|assistant|>
15
+ library_name: transformers
16
+ pipeline_tag: text-generation
17
+ ---
18
+ # Tiny-llama
19
+ ## Model Description
20
+ Tiny llamix is a model built from [TinyLlama](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) using [Charles Goddard's](https://github.com/cg123) mergekit on the mixtral branch.
21
+
22
+ ## Configuration
23
+ ```yaml
24
+ base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
25
+ gate_mode: hidden
26
+ dtype: bfloat16
27
+ experts:
28
+ - source_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
29
+ positive_prompts:
30
+ - "M1"
31
+ - source_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
32
+ positive_prompts:
33
+ - "M2"
34
+ ```
35
+ ## Usage
36
+ It can be used like any other model
37
+ ```python
38
+ from transformers import AutoModelForCausalLM, AutoTokenizer
39
+ #load model and tokenizer
40
+ model = AutoModelForCausalLM.from_pretrained("SE6446/Tiny-llamix").to("cuda")
41
+ tokenizer = AutoTokenizer.from_pretrained("SE6446/Tiny-llamix")
42
+ #write and tokenize prompt
43
+ instruction = '''<|system|>\nYou are a chatbot who can help code!</s>
44
+ <|user|> Write me a function to calculate the first 10 digits of the fibonacci sequence in Python and print it out to the CLI.</s>
45
+ <|assistant|>'''
46
+ inputs = tokenizer(instruction, return_tensors="pt", return_attention_mask=False).to("cuda")
47
+
48
+ #generate
49
+ outputs = model.generate(**inputs, max_length=200)
50
+
51
+ #print
52
+ text = tokenizer.batch_decode(outputs)[0]
53
+ print(text)
54
+ ```
55
+ ## Performance (coming soon!)