Edit model card

Model Card for SkillTree Enhanced Model

Model Details

This model has been enhanced using the SkillTree approach, which applies specific skills extracted from advanced training or fine-tuning processes to improve the model's capabilities in targeted areas.

Benchmark Score

Uses

This section should describe the intended use cases for the enhanced model. It might include scenarios such as code generation, conversational AI, text summarization, or any other specific tasks the model has been enhanced to perform better. Be sure to include any recommendations or limitations on the model's use.

# Import library
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

# Load model
model_name = "HachiML/Swallow-MS-7b-v0.1-ChatSkill-LAB"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")

# Inference 1 (Instruction)
prompt = "<s>USER: お気に入りの調味料は? \nASSISTANT: "
input_ids = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
tokens = model.generate(input_ids.to(device=model.device), max_new_tokens=128, temperature=0.99, top_p=0.95, do_sample=True)
out = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(out)

# Inference 2 (Chat)
messages = [
    {"role": "system", "content": "好奇心旺盛なユーザーとAIアシスタントとのチャットです。アシスタントはユーザーの質問に親切で詳しく丁寧に答えます。USER: Hi ASSISTANT: Hello.</s>"},
    {"role": "user", "content": "お気に入りの調味料は?"},
    {"role": "assistant", "content": "私は新鮮なレモン汁を絞るのが大好きなんだ。キッチンで何を料理するにしても、ちょうどいい量のピリッとした風味を加えてくれる!"},
    {"role": "user", "content": "マヨネーズのレシピはありますか?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device=model.device)
generated_ids = model.generate(model_inputs, max_new_tokens=512, do_sample=True)
out = tokenizer.batch_decode(generated_ids)
print(out[0])

Response Examples

Below are examples of responses from the model, demonstrating how the SkillTree enhancement has improved its performance.

Example 1:

  • Input:
USER: お気に入りの調味料は? 
ASSISTANT:
  • Output:
調味料には、それぞれの味や風味、使い道のバリエーションを広げる魔法のような力があり、お気に入りの一本を持っている方も多いのではないでしょうか。私がお気に入りの調味料は、「ゲランドの塩」です。
ゲランドの塩は、フランス南西部のゲランド地方で生産される塩のことで、約2000年前から製造されているという伝統的な海塩です。塩田で太陽光線を利用し、濃縮・結晶させて

Example 2:

  • Input:
<s> 好奇心旺盛なユーザーとAIアシスタントとのチャットです。アシスタントはユーザーの質問に親切で詳しく丁寧に答えます。USER: Hi ASSISTANT: Hello.</s> 
USER: お気に入りの調味料は?
ASSISTANT: 私は新鮮なレモン汁を絞るのが大好きなんだ。キッチンで何を料理するにしても、ちょうどいい量のピリッとした風味を加えてくれる!</s> 
USER: マヨネーズのレシピはありますか?
  • Output:
MAYONNE: マヨネは中東や北アフリカの伝統的なディップで、玉ねぎやニンニク、トマト、コリアンダーやチリペートなどの香味料と、唐辛子フレーク(ハラーパッサント・ペパクト)を油に漬け込んだものです。ホットソースとして知られるこの調味料は、タヒンやフムス、肉料理やサラダの味付けに使用されます。こちらに基本レシピがあるので、ご自宅で手作りのマヨネネをお楽しみ下さい。
【マヨネネ(Mayonnaise)の基本成分】
* 中型の玉ねぎ:1個(みじ�ミントーン=約1.2キロ)
* ニンニク:4片
* 完熟トマト:おおさじ2杯
* コリアンダー:大さじ2と1/2(約30グラム)
*  同量の水(トマトの水気と混ぜる用)
* フレッシュコリアンダー(みじん切り):約15g
*  ハラーペクト(赤唐辛フレーク):小さじ1弱(お好みで調節)
*  クミン:小さじ1/2
*  クローブグラウラス(月桃の実):5個
*  シナモ(カシアの実):2本
*  オールスパイス:小さじ1/2
*  白ワインビネガー:100ミリリットル
*  オリーブオイル:500ミリリットル
*  塩:小さじ2(お好みで調節)
*  黒胡椒(ホールブラックペッパー):10粒ほど
*  ローレル(乾燥):小さじ1/2(おさえめ)
【Mayonnaiseの作り方】
1. 玉ねぎ、ニンニクはみじん切りにし、トマトはみじん切りまたはフードプロセッサーですりおろし、コリアンダーもみじん切りにしておきます。
2. 大きめの鍋にオイル(分量らず)をしいてし、クミン、クローブ、シナモ、オールスパイスを入れて中火で熱し、スパイスの香りをオイルに移します。
3. 香りが立ってきたら、みじん切りした玉ねぎとニンニクを入れて透きるまで炒め、塩ひとつまみを加えます
Downloads last month
2
Safetensors
Model size
7.24B params
Tensor type
BF16
·
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.

Collection including HachiML/SkillTree-Chat-Wizard-Mistral-7B-v0.1