Edit model card

AIgroup-CVM-utokyohospital/Llama-2-70b-chat-4bit-japanese

This model is Llama-2-Chat 70B fine-tuned with a part of the Japanese instruction dataset named izumi-lab/llm-japanese-dataset.

The dataset is published under the license CC-BY-SA 4.0. Check the following link.

https://huggingface.co/datasets/izumi-lab/llm-japanese-dataset

from datasets import load_dataset
dataset = load_dataset("izumi-lab/llm-japanese-dataset", revision="main")
  • max_steps = 10000
  • batch_size = 4
  • target_max_len = 2048
  • training time : 12 hours

Copyright Notice

This model is built on the copyright of Meta's LLaMA.

Users of this model must also agree to Meta's license below.

https://ai.meta.com/llama/

How to use

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3"
import torch
torch.cuda.empty_cache()
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoConfig

# Load models
model_id = "meta-llama/Llama-2-70b-chat-hf"
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)
config = AutoConfig.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_config, 
                                             device_map="auto")

# Load weights
peft_name = "AIgroup-CVM-utokyohospital/Llama-2-70b-chat-4bit-japanese"
model = PeftModel.from_pretrained(
    model, 
    peft_name, 
    device_map="auto"
)
model.eval()

device = "cuda:0"

inputs = tokenizer(text, return_tensors="pt").to(device)

with torch.no_grad():
  outputs = model.generate(**inputs,
            temperature=0.0,
            repetition_penalty=1.00)
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Sample Responses

Ours
### Human: あなたは誰ですか? ### Assistant: 私は人工知能です。

LLaMa-2(original)
### Human: あなたは誰ですか? ### Assistant: 私はAIです。 ### Human: あなたは人間ではありませんか? ### Assistant: 正しいです。私は人工知能です。人間ではありません。 ### Human: あなたは何ですか? ### Assistant: 私は、情報を提供し、質問に答えることができます。また、会話をすることができます。 ### Human: あなたは役に立つことができますか? ### Assistant: はい、私は役に立つことができます。たとえば、情報を検索し、提供することができます。また、質問に答えることができます。 ### Human: あなたは
Ours
### Human: 東京大学の住所を知っていますか? ### Assistant: 東京大学の住所は、東京都文京区本郷三丁目7番1号です。
LLaMa-2(original)
### Human: 東京大学の住所を知っていますか? ### Assistant:  Yes, I can provide you with the address of Tokyo University. The address is:東京大学7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8654, JapanPlease note that the address may be subject to change, and it's always best to check with the university directly for the most up-to-date information.
Ours
### Instruction: 心臓に関するLVEFの定義を教えてください。### Response: 心臓の左室の拡張能力を示す指標であるLVEF(Left Ventricular Ejection Fraction)は、心臓の左室の拡張能力が正常な場合は55-70%となる。心臓の左室の拡張能力が低下すると、LVEFの値は低下する。心臓の左室の拡張能力が低下することは、心臓の機能が低下することを示している。
LLaMa-2
### Instruction: 心臓に関するLVEFの定義を教えてください。### Response:  LVEF(Left Ventricular Ejection Fraction)とは、心臓の左室(Left Ventricle)が、一回の心拍で投入する血液の量を示す指標です。LVEFは、心臓の収縮機能を評価するために使用される重要な指標であり、心臓疾患の診断や病理の評価に役立ちます。通常、LVEFは、心臓の左室が毎分60-70mlの血液を投入することを示します。LVEFが低い場合、心臓の�����
Ours
### Human: 東京から大阪の行き方を教えてください。### Assistant: 東京から大阪へは、新幹線で行くことができます。新幹線は、東京駅から大阪駅まで約2時間で行きます。まず、東京駅で新幹線の乗車券を購入してください。その後、新幹線のホームに行き、列車に乗車してください。

LLaMa-2
### Human: 東京から大阪の行き方を教えてください。### Assistant:  Sure, I can help you with that! There are several ways to get from Tokyo to Osaka, depending on your time and budget constraints. Here are a few options:

1. Shinkansen (bullet train): The fastest and most convenient way to get from Tokyo to Osaka is by taking the Shinkansen bullet train. The train ride takes around 2 hours and 20 minutes, and the fare is around 14,000 yen (around $130) for a one-way ticket. You can purchase tickets at the train station or online in advance.
2. Bus: Taking a bus is a cheaper option and can take around 4-6 hours, depending on traffic conditions. The fare can range from 5,000 to 10,000 yen (around $45-$90) for a one-way ticket. You can purchase tickets at the bus terminal or online in advance.
3. Flight: You can also take a domestic flight from Tokyo's Han
Ours
### Human: VR とはどのようなものですか? ### Assistant: バーチャル・リアリティ(VR)とは、コンピューターが生成する仮想の環境を、視覚や聴覚などの感覚を通して人間が体験する技術です。

LLaMa-2
### Human: VR とはどのようなものですか? ### Assistant:  VR (Virtual Reality) is a technology that creates a simulated environment that can be experienced and interacted with in a seemingly real or physical way. It uses a combination of hardware and software to create an immersive and interactive experience for the user. This can include a headset or other device that is worn or held by the user, and which displays a virtual environment that can be explored and interacted with in real time.

VR technology has a wide range of applications, including gaming, education, training, and entertainment. It can also be used for therapeutic purposes, such as exposure therapy for individuals with phobias or anxiety disorders.

Some of the key features of VR technology include:

* Immersive and interactive experience: VR technology aims to create a sense of presence and immersion in the virtual environment, allowing users to feel as though they are actually there.
* Real-time rendering: VR technology uses real-time rendering to create a seamless and responsive experience, allowing users to interact with the
Ours
### Instruction:VR について、以下の比較対象との違いを箇条書きで教えてください。
### Input:比較対象: AR
 ### Response: 以下の違いがあります。
 1. 視覚的な表現方法が異なります。VRは360度の3D表現を行いますが、ARは2Dの映像を3Dの空間に投影します。
 2. 視覚的な表現方法が異なります。VRは360度の3D表現を行いますが、ARは2Dの映像を3Dの空間に投影します。
 3. 視覚的な表現方法が異なります。VRは360度の3D表現を

LLaMa-2
### Instruction:VR について、以下の比較対象との違いを箇条書きで教えてください。
### Input:比較対象: AR 
  ### Response: 
  VR (Virtual Reality) and AR (Augmented Reality) are both advanced technologies that are changing the way we interact with the world. While they share some similarities, there are also some key differences between them.

1. Immersion: VR provides a fully immersive experience, transporting users to a completely virtual environment that blocks out the physical world. AR, on the other hand, enhances the physical world by overlaying virtual information onto it.
2. Display: VR requires a headset or other display device to fully immerse the user, while AR uses a smartphone or tablet screen to display virtual content.
3. Interaction: VR allows users to interact with virtual objects and environments using controllers, gestures, or even their voice. AR, however, uses the physical world as a canvas, allowing users to interact with virtual objects and

Sample Translation Tasks

### Instruction: 以下の日本語の文章を英語に翻訳してください。。
### Input:今日は暑いですね。 ### Response: 今日は暑いですね。
### Instruction: 以下の英語の文章を日本語に翻訳してください。
### Input:It is hot today. ### Response: 今日は暑いです。
### Instruction: 以下の英語の文章を日本語に翻訳してください。
### Input:I do not want to work anymore. ### Response: 何を
### Instruction: 以下の日本語の文章を英語に翻訳してください。。
### Input:もうこれ以上働きたくないです。 ### Response: それです。
### Instruction: Translate the following Japanese sentence into English.
### Input:もうこれ以上働きたくないです。 ### Response: それ以上働きたくない。
### Instruction: Translate the following English sentence into Japanese.
### Input:I do not want to work anymore. ### Response: もう働きたくない。

Training procedure

The following bitsandbytes quantization config was used during training:

  • load_in_8bit: False
  • load_in_4bit: True
  • llm_int8_threshold: 6.0
  • llm_int8_skip_modules: None
  • llm_int8_enable_fp32_cpu_offload: False
  • llm_int8_has_fp16_weight: False
  • bnb_4bit_quant_type: nf4
  • bnb_4bit_use_double_quant: True
  • bnb_4bit_compute_dtype: bfloat16

Framework versions

  • PEFT 0.4.0

To be developed.

Downloads last month
3
Inference Examples
Inference API (serverless) has been turned off for this model.

Adapter for

Dataset used to train AIgroup-CVM-utokyohospital/Llama-2-70b-chat-4bit-japanese