Downloads · 30 days
0
takumi0112/llm-jp-3-13b-finetune-it
llm-jp-3-13b-finetune-it is a machine learning model from takumi0112. 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: takumi0112 - License: apache-2.0 - Finetuned from model : llm-jp/llm-jp-3-13b
Downloads · 30 days
0
Access
Public
Updated Dec 14, 2024
Repo size
501 MB
Likes
1
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-3-13b-finetune-it は、大規模言語モデル llm-jp/llm-jp-3-13b をベースに、特定のデータセットに対する性能向上を目的としてファインチューニングしたモデルです。本モデルは、コンペティション「Elyza-Tasks-100-TV」で使用される特有のデータセットに対して最適化されています。
ichikara-instruction-003-001-1.json)
r: 32target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]lora_alpha: 32lora_dropout: 0.05max_seq_length: 512pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
pip install --upgrade torch xformers
pip install ipywidgets
from transformers import AutoTokenizer
from unsloth import FastLanguageModel
model_id = "takumi0112/llm-jp-3-13b-finetune-it"
# モデルとトークナイザーのロード
model, tokenizer = FastLanguageModel.from_pretrained(
model_name=model_id,
dtype=None, # デフォルトのデータ型を使用
load_in_4bit=True, # 4bit 量子化モデルをロード
trust_remote_code=True,
)
# 推論モードへの切り替え
FastLanguageModel.for_inference(model)
# 入力テキスト
input_text = "お寿司の作り方を教えてください。"
# プロンプトの作成
prompt = f"""### 指示
{input_text}
### 回答
"""
# トークナイズ
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
)
# 出力結果の取得
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True).split("### 回答")[-1].strip()
# 結果の表示
print(generated_text)