Downloads · 30 days
9
9% of all-time downloads
sociocom/MedPHINER-Llama-3.1-Swallow-8B-Instruct-v0.5
MedPHINER-Llama-3.1-Swallow-8B-Instruct-v0.5 is a machine learning model from sociocom. 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 peft. The card lists the license as other.
Llama-3.1-Swallow-8B-Instruct-v0.5 をベースに、日本語医療テキストのPHIタグ付与タスクにLoRAでファインチューニングしたマージ済みモデルです。
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
98
Public
Parameters
8B
16.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.2 GB · 100%
From the Hugging Face model README
Llama-3.1-Swallow-8B-Instruct-v0.5 をベースに、日本語医療テキストのPHIタグ付与タスクにLoRAでファインチューニングしたマージ済みモデルです。
入力テキスト中の個人情報(PHI: Protected Health Information)に対してタグを付与します。
| タグ | 対象 |
|---|---|
<phi_age> | 年齢 |
<phi_id> | 識別番号 |
<phi_tel> | 電話番号 |
<phi_job> | 職業 |
<phi_location> | 住所・地名 |
<phi_person> | 人名 |
<phi_hospital> | 医療機関名 |
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
model_id = "sociocom/MedPHINER-Llama-3.1-Swallow-8B-Instruct-v0.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
quant_cfg = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype=torch.bfloat16,
quantization_config=quant_cfg,
)
model.eval()
| パラメータ | 値 |
|---|---|
| LoRA rank | 16 |
| LoRA alpha | 64 |
| LoRA dropout | 0.05 |
| 学習エポック数 | 5 |
| バッチサイズ | 8 |
| 学習率 | 2e-4 |
| オプティマイザ | AdamW |
本モデルのベースである Llama-3.1-Swallow-8B-Instruct-v0.5 は以下の2つのライセンスに従います。