YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

LLM-JP-3-13B ファインチューニングモデル

モデル詳細

ベースモデル: llm-jp/llm-jp-3-13b
ファインチューニングモデル: nmczzi/llm-jp-3-13b-finetune-4
量子化: 4ビット量子化 (QLoRA)

インストール 必要なパッケージのインストール:

bash pip install -U bitsandbytes transformers accelerate datasets peft

使用方法 以下は、モデルの基本的な使用例です:

python from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig from peft import PeftModel import torch

HF_TOKEN = "有効なHuggingFaceトークン"

base_model_id = "llm-jp/llm-jp-3-13b" adapter_id = "nmczzi/llm-jp-3-13b-finetune-4"

QLoRA設定

bnb_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, )

モデルの読み込み

model = AutoModelForCausalLM.from_pretrained( base_model_id, quantization_config=bnb_config, device_map="auto", token=HF_TOKEN )

トークナイザーの読み込み

tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True, token=HF_TOKEN)

ファインチューニングされたアダプターの読み込み

model = PeftModel.from_pretrained(model, adapter_id, token=HF_TOKEN)

使用例

prompt = "### 指示\nあなたの指示をここに入力してください\n### 回答\n" inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad(): outputs = model.generate(**inputs, max_new_tokens=100, do_sample=False, repetition_penalty=1.2)

response = tokenizer.decode(outputs[0], skip_special_tokens=True) print(response)

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.