Edit model card

TinySlime-1.1B-Chat-v1.0

TinySlime は日本語に特化した小規模言語モデルです。

モデルの一覧


このモデルのフルチューニングは、Axolotl を使用して行われました。

Built with Axolotl

モデル概要

TinySlime-1.1B-Chat-v1.0 は、TinySlime-1.1B-Chat-v1.0 をベースに、Mixtral-8x7B-Instruct-v0.1 が作成した合成データを使用して微調整されたチャットモデルです。
このモデルは、スマートフォンや NVIDIA Jetson などの組み込み環境で動かすことを想定して作成されました。

ベンチマーク(JP Language Model Evaluation Harness)

model name JCommonsenseQA (3-shot) JNLI (3-shot) MARC-ja (0-shot) JSQuAD (2-shot) jaqket-v2 (1-shot) xlsum (1-shot) xwinograd (0-shot) mgsm (5-shot) AVERAGE
lkarasu-1.1B 24.84 34.78 50.48 51.33 18.95 9.21 62.15 2.80 31.82
TinySlime-Chat 66.49 64.36 92.68 84.60 42.14 7.79 60.69** 9.20 53.50
japanese-large-lm-3.6b-instruction-sft 38.87 34.68 50.52 58.57 56.54 6.25 64.23 1.60 38.91
open-calm-3b 31.64 36.56 50.99 51.47 50.99 4.63 63.30 2.00 35.97
bilingual-gpt-neox-4b-instruction-ppo 50.49 38.90 88.65 72.82 65.65 4.69 64.75 3.80 48.72
japanese-gpt-neox-3.6b-instruction-ppo 44.59 35.25 64.34 58.53 26.67 3.79 68.72 3.20 33.26

使用方法

インストール

このモデルを使用するには、Hugging Face のtransformersライブラリをインストールする必要があります

pip install -U transformers

モデルの読み込み

transformersライブラリを使用してモデルを読み込むことができます

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "2121-8/TinySlime-1.1B-Chat-v1.0"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

テキスト生成

以下の例では、読み込んだモデルを使用してテキストを生成する方法を示します

text = "こんにちは"

messages = [
    {
        "role": "system",
        "content": "You are an assistant called ChatBot. You are a friendly and very good chatbot.",
    },
    {"role": "user", "content": text},
  ]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
input_ids = tokenizer(prompt, return_tensors="pt")

# テキストを生成
outputs = model.generate(input_ids, max_length=50, num_return_sequences=1)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)

print(generated_text)

謝辞

このモデルは、TinyLlama プロジェクトの成果に基づいて構築されました。NLP コミュニティへの貢献に感謝します。 また、このモデルの開発にあたり、Axolotl のサポートとツールを利用しました。 NLP コミュニティへの貢献に感謝します。

Downloads last month
42
Safetensors
Model size
1.1B params
Tensor type
BF16
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for 2121-8/TinySlime-1.1B-Chat-v1.0

Quantizations
1 model

Collection including 2121-8/TinySlime-1.1B-Chat-v1.0