Views
No views yet

rinna/bilingual-gpt-neox-4b-instruction-sft and has been aligned to serve as an instruction-following conversational agent.rinna/bilingual-gpt-neox-4b-instruction-sft.| Variant | Link |
|---|---|
| Bilingual 4B MiniGPT4 | https://huggingface.co/rinna/bilingual-gpt-neox-4b-minigpt4 |
| Bilingual 4B PPO | https://huggingface.co/rinna/bilingual-gpt-neox-4b-instruction-ppo |
| Bilingual 4B SFT | https://huggingface.co/rinna/bilingual-gpt-neox-4b-instruction-sft |
| Bilingual 4B 8K | https://huggingface.co/rinna/bilingual-gpt-neox-4b-8k |
| Bilingual 4B | https://huggingface.co/rinna/bilingual-gpt-neox-4b |
| Japanese 3.6B PPO | https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-ppo |
| Japanese 3.6B SFT-v2 | https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-sft-v2 |
| Japanese 3.6B SFT | https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-sft |
| Japanese 3.6B | https://huggingface.co/rinna/japanese-gpt-neox-3.6b |
| Model | 4-task average accuracy | 6-task average accuracy |
|---|---|---|
| bilingual-gpt-neox-4b-instruction-ppo | 61.01 | 61.16 |
| bilingual-gpt-neox-4b-instruction-sft | 61.02 | 61.69 |
| bilingual-gpt-neox-4b | 56.12 | 51.83 |
| japanese-gpt-neox-3.6b-instruction-ppo | 59.86 | 60.07 |
| japanese-gpt-neox-3.6b | 55.07 | 50.32 |
ユーザー and システム."ユーザー" or "システム"), (2) a colon (":"), (3) a whitespace (" "), and (4) utterance text (e.g. "世界で一番高い山は?")."システム: " to acknowledge the model to generate a response.\n.1prompt = [
2 {
3 "speaker": "ユーザー",
4 "text": "Hello, you are an assistant that helps me learn Japanese."
5 },
6 {
7 "speaker": "システム",
8 "text": "Sure, what can I do for you?"
9 },
10 {
11 "speaker": "ユーザー",
12 "text": "VRはなんですか。"
13 }
14]
15prompt = [
16 f"{uttr['speaker']}: {uttr['text']}"
17 for uttr in prompt
18]
19prompt = "\n".join(prompt)
20prompt = (
21 prompt
22 + "\n"
23 + "システム: "
24)
25print(prompt)
26"""
27ユーザー: Hello, you are an assistant that helps me learn Japanese.
28システム: Sure, what can I do for you?
29ユーザー: VRはなんですか。
30システム:
31"""temperature, top_p, top_k, repetition_penalty), it is suggested to explore the best setting for your task.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4tokenizer = AutoTokenizer.from_pretrained("rinna/bilingual-gpt-neox-4b-instruction-ppo", use_fast=False)
5model = AutoModelForCausalLM.from_pretrained("rinna/bilingual-gpt-neox-4b-instruction-ppo")
6
7if torch.cuda.is_available():
8 model = model.to("cuda")
9
10token_ids = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
11
12with torch.no_grad():
13 output_ids = model.generate(
14 token_ids.to(model.device),
15 max_new_tokens=512,
16 do_sample=True,
17 temperature=1.0,
18 top_p=0.85,
19 pad_token_id=tokenizer.pad_token_id,
20 bos_token_id=tokenizer.bos_token_id,
21 eos_token_id=tokenizer.eos_token_id
22 )
23
24output = tokenizer.decode(output_ids.tolist()[0][token_ids.size(1):])
25print(output)
26"""VRとはVirtual Realityの略で、仮想現実とも呼ばれます。これは、コンピューターを使用して仮想世界を作り出し、仮想世界上でコンピューターのゲームや仮想世界を体験するための技術です。この技術は、コンピューターやモバイ ルデバイスの進歩によって、2015年以降、ますます普及しています。VRは、ゲームや仮想世界、その他のアプリケー ションなどのさまざまな分野で、コンピューターと人間の相互作用の新しい方法を提供しています。</s>"""<UNK> tokens._Hello).
use_fast=False to make the above features function correctly.1@misc{rinna-bilingual-gpt-neox-4b-instruction-ppo,
2 title = {rinna/bilingual-gpt-neox-4b-instruction-ppo},
3 author = {Zhao, Tianyu and Sawada, Kei},
4 url = {https://huggingface.co/rinna/bilingual-gpt-neox-4b-instruction-ppo}
5}
6
7@inproceedings{sawada2024release,
8 title = {Release of Pre-Trained Models for the {J}apanese Language},
9 author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
10 booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
11 month = {5},
12 year = {2024},
13 pages = {13898--13905},
14 url = {https://aclanthology.org/2024.lrec-main.1213},
15 note = {\url{https://arxiv.org/abs/2404.01657}}
16}