Downloads · 30 days
0
miyapu/llm-jp-3-13b-miyapu01_lora
llm-jp-3-13b-miyapu01_lora is a machine learning model from miyapu. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
- Developed by: miyapu - License: apache-2.0 - Finetuned from model : llm-jp/llm-jp-3-13b
Downloads · 30 days
0
Access
Public
Updated Dec 17, 2024
Repo size
501 MB
Likes
0
Public
Click a slice to open those files.
.safetensors501 MB · 99%
From the Hugging Face model README
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
llm-jp/llm-jp-3-13b をベースモデルとして、Ichikara Instruction データセットを用いてファインチューニングしたものです。
from unsloth import FastLanguageModel
HF_TOKEN = "your_hf_token"
model_id = "miyapu/llm-jp-3-13b-miyapu01_lora"
max_seq_length = 512
dtype = None
load_in_4bit = True
# modelインスタンス作成
model, tokenizer = FastLanguageModel.from_pretrained(
model_name=model_id,
dtype=dtype,
load_in_4bit=load_in_4bit,
trust_remote_code=True,
token=HF_TOKEN
)
# 推論するためにModelモードを変更
FastLanguageModel.for_inference(model)
# 推論テスト例 (プロンプト入力テキスト)
input = "あなたは小説家です。小説の中で自然の壮大さを表現する文章を執筆しています。以下は、その文章の一部です。\n「フィンランドに最も深い大渓谷がある。」\nこの文章を、より鮮やかで具体性のある表現に置き換えて、フィンランドの景観の素晴らしさや渓谷の壮大さと深さをより強く表現する文章を作成してください。"
prompt = f"""### 指示\n{input}\n### 回答\n"""
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, use_cache=True, do_sample=False, repetition_penalty=1.2)
prediction = tokenizer.decode(outputs[0], skip_special_tokens=True).split('\n### 回答')[-1]
print(f"input={input} output={prediction}")