Downloads · 30 days
0
Kendamarron/jimba-instruction-evolver-alpha_RakutenAI-7B-instruct_lora
jimba-instruction-evolver-alpha_RakutenAI-7B-instruct_lora is a machine learning model from Kendamarron. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
与えられたinstructionをより難易度の高いものに書き換えるモデルを試験的に作成したものになります。
Downloads · 30 days
0
Access
Public
Updated Apr 1, 2024
Repo size
421 MB
Likes
2
Public
Click a slice to open those files.
.pt336 MB · 79%
From the Hugging Face model README
与えられたinstructionをより難易度の高いものに書き換えるモデルを試験的に作成したものになります。
instructionデータセット作成にお役立てください。
不適切なinstructionが生成される可能性がありますので、出力のチェックは必須です。
詳細についてはこちらをご覧ください。
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
model_path = "Rakuten/RakutenAI-7B-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(
model,
"Kendamarron/jimba-instruction-evolver-alpha_RakutenAI-7B-instruct_lora"
)
model.eval()
input_instruction = "今日の夜ご飯を考えてください。"
system_message = """A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: 次の指示文をより複雑なものに修正してください。
指示文: {orininal_instruction} ASSISTANT: """
inputs = tokenizer(system_message.format(original_instruction=input_instruction), return_tensors="pt").to(device=model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.8,
eos_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0],skip_special_tokens=True))
Discordサーバー「ローカルLLMに向き合う会」とメタデータラボ株式会社が共同開催された「LOCAL AI HACKATHON #000」にて作成した成果物になります。