Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- OpenAssistant/oasst1
|
5 |
+
- zetavg/ShareGPT-Processed
|
6 |
+
- augmxnt/ultra-orca-boros-en-ja-v1
|
7 |
+
language:
|
8 |
+
- ja
|
9 |
+
- en
|
10 |
+
---
|
11 |
+
|
12 |
+
|
13 |
+
<p align="center">
|
14 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/64b63f8ad57e02621dc93c8b/3uLNwKHFwEgT2YQ-BGOiH.png" alt="drawing" width="600"/>
|
15 |
+
</p>
|
16 |
+
|
17 |
+
# How to use
|
18 |
+
|
19 |
+
|
20 |
+
### Hugggingface
|
21 |
+
```python
|
22 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
23 |
+
import torch
|
24 |
+
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("lightblue/karasu-7B-chat-plus")
|
26 |
+
model = AutoModelForCausalLM.from_pretrained("lightblue/karasu-7B-chat-plus", torch_dtype=torch.bfloat16, device_map="auto")
|
27 |
+
|
28 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
29 |
+
|
30 |
+
messages = [{"role": "system", "content": "あなたはAIアシスタントです。"}]
|
31 |
+
messages.append({"role": "user", "content": "イギリスの首相は誰ですか?"})
|
32 |
+
|
33 |
+
prompt = tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, tokenize=False)
|
34 |
+
|
35 |
+
pipe(prompt, max_new_tokens=100, do_sample=False, temperature=0.0, return_full_text=False)
|
36 |
+
```
|
37 |
+
|
38 |
+
|
39 |
+
### VLLM
|
40 |
+
```python
|
41 |
+
from vllm import LLM, SamplingParams
|
42 |
+
|
43 |
+
sampling_params = SamplingParams(temperature=0.0, max_tokens=100)
|
44 |
+
llm = LLM(model="lightblue/karasu-7B-chat-plus")
|
45 |
+
|
46 |
+
messages = [{"role": "system", "content": "あなたはAIアシスタントです。"}]
|
47 |
+
messages.append({"role": "user", "content": "イギリスの首相は誰ですか?"})
|
48 |
+
prompt = llm.llm_engine.tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, tokenize=False)
|
49 |
+
prompts = [prompt]
|
50 |
+
|
51 |
+
outputs = llm.generate(prompts, sampling_params)
|
52 |
+
for output in outputs:
|
53 |
+
prompt = output.prompt
|
54 |
+
generated_text = output.outputs[0].text
|
55 |
+
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
56 |
+
```
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
# Base checkpoint
|
61 |
+
[lightblue/karasu-7B](https://huggingface.co/lightblue/karasu-7B)
|
62 |
+
|
63 |
+
# Training datasets (total ~7B)
|
64 |
+
The same as the 'plus' checkpoint, but with about 6K refusals ("申し訳ありませんが、。。。") filtered out from the category dataset
|
65 |
+
* Lightblue's suite of Kujira datasets (unreleased)
|
66 |
+
* Lightblue's own question-based datasets (unreleased)
|
67 |
+
* Lightblue's own category-based datasets (unreleased)
|
68 |
+
* [OASST](https://huggingface.co/datasets/OpenAssistant/oasst1) (Japanese chats only)
|
69 |
+
* [ShareGPT](https://huggingface.co/datasets/zetavg/ShareGPT-Processed) (Japanese chats only)
|
70 |
+
* [augmxnt/ultra-orca-boros-en-ja-v1](https://huggingface.co/datasets/augmxnt/ultra-orca-boros-en-ja-v1) (['airoboros', 'slimorca', 'ultrafeedback', 'airoboros_ja_new'] only)
|
71 |
+
|
72 |
+
# Developed by
|
73 |
+
|
74 |
+
<a href="https://www.lightblue-tech.com">
|
75 |
+
<img src="https://www.lightblue-tech.com/wp-content/uploads/2021/10/LBlogo-scaled.jpg" alt="Lightblue technology logo" width="400"/>
|
76 |
+
</a>
|
77 |
+
|
78 |
+
### Engineers
|
79 |
+
Peter Devine
|
80 |
+
|
81 |
+
Sho Higuchi
|
82 |
+
|
83 |
+
### Advisors
|
84 |
+
Yuuki Yamanaka
|
85 |
+
|
86 |
+
Atom Sonoda
|
87 |
+
|
88 |
+
### Dataset evaluator
|
89 |
+
Renju Aoki
|