Uploaded model

  • Developed by: MMMio
  • 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.

README

モデル概要

本モデルは、日本語事前学習済みモデル llm-jp/llm-jp-3-13bに、ichikara-instruction: LLMのための日本語インストラクションデータを用いて Fine-Tuning したモデルです。

ライセンス

本モデルは、CC-BY-NC-SA ライセンスの下で公開されています。

  1. 著作権表示 (BY): モデルを使用する場合は、必ず著作者にクレジットを付与してください。
  2. 非商用 (NC): モデルの使用は非商用目的に限定されます。
  3. 継承 (SA): このモデルを基にした成果物も CC-BY-NC-SA 4.0 の下で公開する必要があります。 元モデルは Apache 2.0 ライセンスの下で提供されており、Fine-Tune のデータセットは CC-BY-NC-SA 4.0 に基づいています。 結果として、このモデルは CC-BY-NC-SA 4.0 ライセンスに準じます。

使用方法

以下は、ELYZA-tasks-100-TV を出力するためのコードです。

from unsloth import FastLanguageModel
import torch, json
from tqdm import tqdm

model_name = "MMMio/llm-jp-3-13b-it"
# あなたの Huggingface トークン
HF_TOKEN = 'your_huggingface_token'

max_seq_length = 2048
dtype = None
load_in_4bit = True

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = model_name,
    max_seq_length = max_seq_length,
    dtype = dtype,
    load_in_4bit = load_in_4bit,
    token = HF_TOKEN,
)
FastLanguageModel.for_inference(model)

# データセットの読み込み。
# omnicampusの開発環境では、左にタスクのjsonlをドラッグアンドドロップしてから実行。
datasets = []
with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
    item = ""
    for line in f:
      line = line.strip()
      item += line
      if item.endswith("}"):
        datasets.append(json.loads(item))
        item = ""

# 推論
results = []
results_2 = []
for dt in tqdm(datasets):
  task_id = dt["task_id"]
  input = dt["input"]

  prompt = f"""### 指示\n{input}\n### 回答\n"""
  inputs = tokenizer([prompt], return_tensors = "pt").to(model.device)
  output = model.generate(**inputs, max_new_tokens = 512, use_cache = True, do_sample=False, repetition_penalty=1.2)
  prediction = tokenizer.decode(output[0], skip_special_tokens=True).split('\n### 回答')[-1]
  results_2.append({"task_id": task_id, "input": input, "output": prediction})

# ディレクトリを作成(存在しない場合)
filename = model_name.split('/')[-1]
with open(f"./{filename}_output.jsonl", mode='w', encoding='utf-8') as f:
    for result in results_2:
        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 MMMio/llm-jp-3-13b-it

Finetuned
(1124)
this model