Downloads · 30 days
8
20% of all-time downloads
KenshiKawaguchi/AISystem2-fh-Llama-3.1-2507
AISystem2-fh-Llama-3.1-2507 is a text generation model from KenshiKawaguchi. Use it when you need the model to write or continue text. It is set up for peft.
このLoRAアダプタは、静岡大学情報学部行動情報学科3年を対象に2025年度前期に開講された「知的情報システム開発Ⅱ」において開発者がモデル比較を行うために作られました。
Downloads · 30 days
8
20% of all-time downloads
All-time downloads
40
Public
Repo size
432 MB
Likes
1
Public
Click a slice to open those files.
.safetensors414 MB · 96%
From the Hugging Face model README
このLoRAアダプタは、静岡大学情報学部行動情報学科3年を対象に2025年度前期に開講された「知的情報システム開発Ⅱ」において開発者がモデル比較を行うために作られました。
KenshiKawaguchi/AISystem2-fh-Llama-3.1-2507は、ベースモデルであるcyberagent/Llama-3.1-70B-Japanese-Instruct-2407に対して、正確にがんの家族歴情報を抽出・判定できるように微調整したモデルのLoRAアダプタです。cyberagent/Llama-3.1-70B-Japanese-Instruct-2407も指定するようにしてください。import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
base_model_id = "cyberagent/Llama-3.1-70B-Japanese-Instruct-2407"
lora_adapter_id = "AiSystem2/llama3-fh-lora-2507"
tokenizer = AutoTokenizer.from_pretrained(lora_adapter_id, use_fast=False)
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base_mlora_adapter_id).eval()
messages = [
{"role": "system","content": "あなたは電子カルテから血縁家族のがん歴を抽出する専門家です。"},
{"role": "user", "content": "<カルテ本文をここに>"},
]
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
generated_ids = model.generate(input_ids, max_new_tokens=128, do_sample=False, temperature=0.0)[0]
print(tokenizer.decode(generated_ids[input_ids.shape[-1] :], skip_special_tokens=True))
上記のコードは簡易的なものであり、実装において用いたコードではありません。実装で使ったファイルは提出ファイル(inferrred_extract_multiFamilyHistory_llama3.py)を参照してください。
記述の内容や権利関係等の不備はどうかご容赦ください 一度体験してみたい気持ちのみで作りました。