Uploaded model

  • Developed by: ikedachin
  • License: apache-2.0
  • Finetuned from model : ikedachin/llm-jp-3-13b-october-news-250128-1-merged

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

継続事前学習モデル

ikedachin/llm-jp-3-13b-october-news-e1-all-3-5

学習データセット

以下をシャッフルして使用

  • llm-jp/magpie-sft-v1.0からランダムに5000データ
  • DeL-TaiseiOzaki/Tengentoppa-sft-mini-vol1.0からランダムに15000データ

実行方法

ライブラリインストール

pip install transformers

実行コード

# import libraries
import tqdm
import torch
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer

# config
model_id = "ikedachin/llm-jp-3-13b-october-news-250128-1-merged-sft-1-bf16_merged"

# set Token of Huggingface
HF_TOKEN = <<YOUR_TOKEN>>

# download model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map = "auto",
    torch_dtype = torch.bfloat16,
    token = HF_TOKEN
)
tokenizer = AutoTokenizer.from_pretrained(model_id, token=HF_TOKEN)


# define inference function
def generate_from_model(input):
    prompt =  f"""### 指示\n{input}\n### 回答\n"""
    input = tokenizer(prompt, return_tensors='pt', add_special_tokens=True).to(model.device)
    input.pop('token_type_ids')
    output = model.generate(**input, max_new_tokens = 1000, use_cache = False, do_sample=False, repetition_penalty=1.2)
    return tokenizer.decode(output[0], skip_special_tokens=True).split('### 回答\n')[-1]

# input prompt and inference
print(generate_from_model('石破茂さんって誰ですか?'))
# 石破茂(いしばしげる、1954年-)は、日本の政治家、元防衛大臣です。彼は自民党の議員で、現在は第102代内閣総理大臣を務めています。
Downloads last month
0
Safetensors
Model size
13.7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ikedachin/llm-jp-3-13b-october-news-250128-1-merged-sft-1-bf16_merged

Datasets used to train ikedachin/llm-jp-3-13b-october-news-250128-1-merged-sft-1-bf16_merged

Collection including ikedachin/llm-jp-3-13b-october-news-250128-1-merged-sft-1-bf16_merged