elyza / ELYZA-japanese-Llama-2-7b

huggingface.co
Total runs: 654
24-hour runs: 0
7-day runs: 32
30-day runs: 221
Model's Last Updated: August 29 2023
text-generation

Introduction of ELYZA-japanese-Llama-2-7b

Model Details of ELYZA-japanese-Llama-2-7b

ELYZA-japanese-Llama-2-7b

ELYZA-Japanese-Llama2-image

Model Description

ELYZA-japanese-Llama-2-7b は、 Llama2をベースとして日本語能力を拡張するために追加事前学習を行ったモデルです。 詳細は Blog記事 を参照してください。

Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

B_INST, E_INST = "[INST]", "[/INST]"
B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n"
DEFAULT_SYSTEM_PROMPT = "あなたは誠実で優秀な日本人のアシスタントです。"
text = "クマが海辺に行ってアザラシと友達になり、最終的には家に帰るというプロットの短編小説を書いてください。"

model_name = "elyza/ELYZA-japanese-Llama-2-7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto")

if torch.cuda.is_available():
    model = model.to("cuda")

prompt = "{bos_token}{b_inst} {system}{prompt} {e_inst} ".format(
    bos_token=tokenizer.bos_token,
    b_inst=B_INST,
    system=f"{B_SYS}{DEFAULT_SYSTEM_PROMPT}{E_SYS}",
    prompt=text,
    e_inst=E_INST,
)


with torch.no_grad():
    token_ids = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")

    output_ids = model.generate(
        token_ids.to(model.device),
        max_new_tokens=256,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
    )
output = tokenizer.decode(output_ids.tolist()[0][token_ids.size(1) :], skip_special_tokens=True)
print(output)
"""
承知しました。以下にクマが海辺に行ってアザラシと友達になり、最終的には家に帰るというプロットの短編小説を記述します。

クマは山の中でゆっくりと眠っていた。
その眠りに落ちたクマは、夢の中で海辺を歩いていた。
そこにはアザラシがいた。
クマはアザラシに話しかける。

「おはよう」とクマが言うと、アザラシは驚いたように顔を上げた。
「あ、こんにちは」アザラシは答えた。
クマはアザラシと友達になりたいと思う。

「私はクマと申します。」クマは...
"""
ELYZA-japanese-Llama-2-7b Models
Developers

以下アルファベット順

Licence

Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.

How to Cite
@misc{elyzallama2023, 
      title={ELYZA-japanese-Llama-2-7b}, 
      url={https://huggingface.co/elyza/ELYZA-japanese-Llama-2-7b}, 
      author={Akira Sasaki and Masato Hirakawa and Shintaro Horie and Tomoaki Nakamura},
      year={2023},
}
Citations
@misc{touvron2023llama,
      title={Llama 2: Open Foundation and Fine-Tuned Chat Models}, 
      author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
      year={2023},
      eprint={2307.09288},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Runs of elyza ELYZA-japanese-Llama-2-7b on huggingface.co

654
Total runs
0
24-hour runs
-2
3-day runs
32
7-day runs
221
30-day runs

More Information About ELYZA-japanese-Llama-2-7b huggingface.co Model

More ELYZA-japanese-Llama-2-7b license Visit here:

https://choosealicense.com/licenses/llama2

ELYZA-japanese-Llama-2-7b huggingface.co

ELYZA-japanese-Llama-2-7b huggingface.co is an AI model on huggingface.co that provides ELYZA-japanese-Llama-2-7b's model effect (), which can be used instantly with this elyza ELYZA-japanese-Llama-2-7b model. huggingface.co supports a free trial of the ELYZA-japanese-Llama-2-7b model, and also provides paid use of the ELYZA-japanese-Llama-2-7b. Support call ELYZA-japanese-Llama-2-7b model through api, including Node.js, Python, http.

ELYZA-japanese-Llama-2-7b huggingface.co Url

https://huggingface.co/elyza/ELYZA-japanese-Llama-2-7b

elyza ELYZA-japanese-Llama-2-7b online free

ELYZA-japanese-Llama-2-7b huggingface.co is an online trial and call api platform, which integrates ELYZA-japanese-Llama-2-7b's modeling effects, including api services, and provides a free online trial of ELYZA-japanese-Llama-2-7b, you can try ELYZA-japanese-Llama-2-7b online for free by clicking the link below.

elyza ELYZA-japanese-Llama-2-7b online free url in huggingface.co:

https://huggingface.co/elyza/ELYZA-japanese-Llama-2-7b

ELYZA-japanese-Llama-2-7b install

ELYZA-japanese-Llama-2-7b is an open source model from GitHub that offers a free installation service, and any user can find ELYZA-japanese-Llama-2-7b on GitHub to install. At the same time, huggingface.co provides the effect of ELYZA-japanese-Llama-2-7b install, users can directly use ELYZA-japanese-Llama-2-7b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

ELYZA-japanese-Llama-2-7b install url in huggingface.co:

https://huggingface.co/elyza/ELYZA-japanese-Llama-2-7b

Url of ELYZA-japanese-Llama-2-7b

ELYZA-japanese-Llama-2-7b huggingface.co Url

Provider of ELYZA-japanese-Llama-2-7b huggingface.co

elyza
ORGANIZATIONS

Other API from elyza