aipib commited on
Commit
c8b27bd
·
verified ·
1 Parent(s): f76a808

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -3
README.md CHANGED
@@ -1,3 +1,37 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - niryuu/Karasu-1.1b-chat-vector
4
+ language:
5
+ - ja
6
+ - en
7
+ ---
8
+ # karasu-chatvector-mlx_lm-chatalpaca
9
+
10
+ karasu fine tuned model by lora method with alpaca_cleaned_ja_json.
11
+ * Base model: niryuu/Karasu-1.1b-chat-vector
12
+ * Traning dataset: shi3z/alpaca_cleaned_ja_json formatted by mlx's chat-template
13
+
14
+ ## 💻 Usage
15
+
16
+ ```python
17
+ !pip install -qU transformers accelerate
18
+
19
+ from transformers import AutoTokenizer
20
+ import transformers
21
+ import torch
22
+
23
+ model = "aipib/suzume-taskarith1"
24
+ messages = [{"role": "user", "content": "What is a large language model?"}]
25
+
26
+ tokenizer = AutoTokenizer.from_pretrained(model)
27
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
28
+ pipeline = transformers.pipeline(
29
+ "text-generation",
30
+ model=model,
31
+ torch_dtype=torch.float16,
32
+ device_map="auto",
33
+ )
34
+
35
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
36
+ print(outputs[0]["generated_text"])
37
+ ```