aipib/llm-jp-3.1-1.8b-function-calling

🤗 Hugging Face sourcetext-generationapache-2.01.9B params3.7 GBsafetensors✓ 2 checksumsupdated today
Submit in one command

Run it next to your model folder. It makes the torrent, checks your files against Hugging Face, and submits it. You just start seeding and paste your key from your account. It only reads your files and never changes them. Read the script first if you like.

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo aipib/llm-jp-3.1-1.8b-function-calling ./model-folder
Needs a seeder →

aipib/llm-jp-3.1-1.8b-function-calling

The Model aipib/llm-jp-3.1-1.8b-function-calling was finetuned with nappa0326/glaive-function-calling-v2-sharegpt-japanese dataset from mlx-community/llm-jp-3.1-1.8b-instruct4-4bit.

Use with mlx

You need to convert this model to mlx model with mlx-lm.convert. Otherwise, please refer to the Llama3.2 tool-calling method or call this model from some Agent.

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("aipib/llm-jp-3.1-1.8b-function-calling")

prompt="""<bos><start_of_turn>user
あなたは関数呼び出しAIモデルです。<tools></tools> XMLタグ内に関数シグネチャが提供されます。ユーザークエリを支援するために、1つ以上の関数を呼び出すことができます。関数に代入する値について、想定しないでください。使用可能なツールは次のとおりです:<tools> [{'type': 'function', 'function': {'name': 'convert_currency', 'description': 'ある通貨から別の通貨に変換する', 'parameters': {'type': 'object', 'properties': {'amount': {'type': 'number', 'description': '変換する金額'}, 'from_currency': {'type': 'string', 'description': '変換元の通貨'}, 'to_currency': {'type': 'string', 'description': '変換後の通貨'}}, 'required': ['amount', 'from_currency', 'to_currency']}}}, {'type': 'function', 'function': {'name': 'calculate_distance', 'description': '2つの場所間の距離を計算します', 'parameters': {'type': 'object', 'properties': {'start_location': {'type': 'string', 'description': '開始場所'}, 'end_location': {'type': 'string', 'description': '終了場所'}}, 'required': ['start_location', 'end_location']}}}] </tools>各ツール呼び出しには、次の pydantic モデル JSON スキーマを使用します: {'title': 'FunctionCall', 'type': 'object', 'properties': {'arguments': {'title': 'Arguments', 'type': 'object'}, 'name': {'title': 'Name', 'type': 'string'}}, 'required': ['arguments', 'name']}関数呼び出しごとに、関数名と引数を含むJSONオブジェクトを、<tool_call></tool_call> XMLタグ内に以下のように記述して返します。
<tool_call>
{tool_call}
</tool_call>また、関数を呼び出す前に、関数が実行する処理について時間をかけて計画を立ててください。<think>{あなたの考え}

こんにちは。500米ドルをユーロに両替したいのですが、手伝っていただけますか?<end_of_turn><eos>
<start_of_turn>assistant
<think>"""

response = generate(model, tokenizer, prompt=prompt, verbose=True, max_tokens=1000)