Update README.md
Browse files
README.md
CHANGED
|
@@ -1 +1,92 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
license_name: tongyi-qianwen-license-agreement
|
| 4 |
+
license_link: >-
|
| 5 |
+
https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT
|
| 6 |
+
datasets:
|
| 7 |
+
- oscar-corpus/OSCAR-2301
|
| 8 |
+
- mc4
|
| 9 |
+
language:
|
| 10 |
+
- ja
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
<p align="center">
|
| 14 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/64c8a2e01c25d2c581a381c1/9CbN4lDGU42c-7DmK_mGM.png" alt="drawing" width="600"/>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
TinyLlama + Japanese pre-training (50,004 steps)
|
| 18 |
+
|
| 19 |
+
# How to use
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
### Hugggingface
|
| 23 |
+
```python
|
| 24 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 25 |
+
import torch
|
| 26 |
+
|
| 27 |
+
tokenizer = AutoTokenizer.from_pretrained("lightblue/karasu-1.1B")
|
| 28 |
+
model = AutoModelForCausalLM.from_pretrained("lightblue/karasu-1.1B", torch_dtype=torch.bfloat16, device_map="auto")
|
| 29 |
+
|
| 30 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 31 |
+
|
| 32 |
+
messages = [{"role": "system", "content": "あなたはAIアシスタントです。"}]
|
| 33 |
+
messages.append({"role": "user", "content": "イギリスの首相は誰ですか?"})
|
| 34 |
+
|
| 35 |
+
prompt = tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, tokenize=False)
|
| 36 |
+
|
| 37 |
+
pipe(prompt, max_new_tokens=100, do_sample=False, temperature=0.0, return_full_text=False)
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
### VLLM
|
| 42 |
+
```python
|
| 43 |
+
from vllm import LLM, SamplingParams
|
| 44 |
+
|
| 45 |
+
sampling_params = SamplingParams(temperature=0.0, max_tokens=100)
|
| 46 |
+
llm = LLM(model="lightblue/karasu-1.1B")
|
| 47 |
+
|
| 48 |
+
messages = [{"role": "system", "content": "あなたはAIアシスタントです。"}]
|
| 49 |
+
messages.append({"role": "user", "content": "イギリスの首相は誰ですか?"})
|
| 50 |
+
prompt = llm.llm_engine.tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, tokenize=False)
|
| 51 |
+
prompts = [prompt]
|
| 52 |
+
|
| 53 |
+
outputs = llm.generate(prompts, sampling_params)
|
| 54 |
+
for output in outputs:
|
| 55 |
+
prompt = output.prompt
|
| 56 |
+
generated_text = output.outputs[0].text
|
| 57 |
+
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
# Base checkpoint
|
| 63 |
+
[Qwen/Qwen-14B-Chat](TinyLlama/TinyLlama-1.1B-intermediate-step-715k-1.5T)
|
| 64 |
+
|
| 65 |
+
# Training datasets (total ~3B)
|
| 66 |
+
A filtered then sampled set from
|
| 67 |
+
* OSCAR (Japanese)
|
| 68 |
+
* mC4 (Japanese)
|
| 69 |
+
|
| 70 |
+
# Developed by
|
| 71 |
+
|
| 72 |
+
<a href="https://www.lightblue-tech.com">
|
| 73 |
+
<img src="https://www.lightblue-tech.com/wp-content/uploads/2023/08/color_%E6%A8%AA%E5%9E%8B-1536x469.png" alt="Lightblue technology logo" width="400"/>
|
| 74 |
+
</a>
|
| 75 |
+
|
| 76 |
+
### Engineers
|
| 77 |
+
Peter Devine
|
| 78 |
+
|
| 79 |
+
Sho Higuchi
|
| 80 |
+
|
| 81 |
+
### Advisors
|
| 82 |
+
Yuuki Yamanaka
|
| 83 |
+
|
| 84 |
+
Atom Sonoda
|
| 85 |
+
|
| 86 |
+
### Project manager
|
| 87 |
+
Shunichi Taniguchi
|
| 88 |
+
|
| 89 |
+
Tomioka Wataru
|
| 90 |
+
|
| 91 |
+
### Dataset evaluator
|
| 92 |
+
Renju Aoki
|