Upload model

  • Developed by: Yumikooo
  • License: apache-2.0
  • Finetuned from model : llm-jp/llm-jp-3-13b

This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.

環境設定

以下のコマンドを使用して必要なライブラリをインストールしてください。

pip install transformers unsloth

モデル概要

このモデルは、Hugging Faceのllm-jp-3-13bを基に、Unslothを使用してFine-Tuningされたものです。 本モデルはELYZA-tasks-100-TVタスクに特化しており、高効率でタスク指向の回答生成が可能です。

モデルの特徴

*タスク特化型:Fine-Tuning済みで、Elyza-tasks-100-TVタスクの出力生成に最適化されています。 *効率的な動作:4bit量子化によりメモリ効率を向上。 *柔軟な構造:LoRAを用いたアダプタ層により、大規模モデルの柔軟性を維持しつつFine-Tuningを高速化。

使用方法

1.モデルとトークナイザーをロード

以下のコードを使用してモデルとトークナイザーをロードします。
from unsloth import FastLanguageModel

model_name = "Yumikooo/llm-jp-3-13b-finetune-2"
HF_TOKEN = "huggingface_token_here"  # Hugging Faceで取得したトークンを入力

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name=model_name,
    token=HF_TOKEN,
    load_in_4bit=True,
)

FastLanguageModel.for_inference(model)  # 推論モードに設定

2.推論を実行

以下のコードを使用して、推論を行います。

input_text = "ここに入力テキストを入れます"
prompt = f"### 指示\n{input_text}\n### 回答\n"
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
prediction = tokenizer.decode(outputs[0], skip_special_tokens=True)

print("予測結果:", prediction)

結果の保存

推論結果をJSONL形式で保存します。
import json

results = [{"task_id": 1, "input": "質問内容", "output": "モデルの回答"}]
with open(f"{model_name}_output.jsonl", 'w', encoding='utf-8') as f:
    for result in results:
        json.dump(result, f, ensure_ascii=False)
        f.write('\n')


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 pipeline_tag.

Model tree for Yumikooo/llm-jp-3-13b-finetune-2

Finetuned
(1122)
this model