Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minicpm3 4b FC model handler #718

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,13 @@
"Apache-2.0",
],
"openbmb/MiniCPM3-4B": [
"MiniCPM3-4B (FC)",
"MiniCPM3-4B (Prompt)",
"https://huggingface.co/openbmb/MiniCPM3-4B",
"openbmb",
"Apache-2.0",
],
"openbmb/MiniCPM3-4B-FC": [
"MiniCPM3-4B-FC (FC)",
"https://huggingface.co/openbmb/MiniCPM3-4B",
"openbmb",
"Apache-2.0",
Expand Down Expand Up @@ -701,10 +707,10 @@
"gemini-1.5-pro-002-FC": 1.25,
"gemini-1.5-pro-001": 1.25,
"gemini-1.5-pro-001-FC": 1.25,
"gemini-1.5-flash-002": 0.075 ,
"gemini-1.5-flash-002-FC": 0.075 ,
"gemini-1.5-flash-001": 0.075 ,
"gemini-1.5-flash-001-FC": 0.075 ,
"gemini-1.5-flash-002": 0.075,
"gemini-1.5-flash-002-FC": 0.075,
"gemini-1.5-flash-001": 0.075,
"gemini-1.5-flash-001-FC": 0.075,
"gemini-1.0-pro-002": 0.5,
"gemini-1.0-pro-002-FC": 0.5,
"databricks-dbrx-instruct": 2.25,
Expand Down Expand Up @@ -776,10 +782,9 @@
# The latency of the open-source models are hardcoded here.
# Because we do batching when generating the data, so the latency is not accurate from the result data.
# This is the latency for the whole batch of data, when using 8 V100 GPUs.
OSS_LATENCY = {
}
OSS_LATENCY = {}

# All OSS models will have no cost shown on the leaderboard.
# All OSS models will have no cost shown on the leaderboard.
NO_COST_MODELS = list(local_inference_handler_map.keys())
# The following models will also have no cost, even though they are queries through the API.
NO_COST_MODELS += [
Expand All @@ -797,7 +802,7 @@
"Salesforce/xLAM-7b-r",
"Salesforce/xLAM-8x7b-r",
"Salesforce/xLAM-8x22b-r",
"Team-ACE/ToolACE-8B",
"Team-ACE/ToolACE-8B",
"MadeAgents/Hammer2.0-7b",
"MadeAgents/Hammer2.0-3b",
"MadeAgents/Hammer2.0-1.5b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@
"THUDM/glm-4-9b-chat",
"ibm-granite/granite-20b-functioncalling",
"yi-large-fc",
"openbmb/MiniCPM3-4B-FC",
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from bfcl.model_handler.oss_model.salesforce import SalesforceHandler
from bfcl.model_handler.oss_model.qwen import QwenHandler
from bfcl.model_handler.oss_model.minicpm import MiniCPMHandler
from bfcl.model_handler.oss_model.minicpm_fc import MiniCPMFCHandler
from bfcl.model_handler.proprietary_model.claude import ClaudeHandler
from bfcl.model_handler.proprietary_model.cohere import CohereHandler
from bfcl.model_handler.proprietary_model.databricks import DatabricksHandler
Expand Down Expand Up @@ -128,6 +129,7 @@
"Qwen/Qwen2.5-7B-Instruct": QwenHandler,
"Team-ACE/ToolACE-8B": LlamaHandler,
"openbmb/MiniCPM3-4B": MiniCPMHandler,
"openbmb/MiniCPM3-4B-FC": MiniCPMFCHandler,
}

# Deprecated/outdated models, no longer on the leaderboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler


class MiniCPMHandler(OSSHandler):
def __init__(self, model_name, temperature) -> None:
super().__init__(model_name, temperature)
Expand All @@ -11,7 +12,9 @@ def _format_prompt(self, messages, function):
formatted_prompt = ""

for message in messages:
formatted_prompt += f"<|im_start|>{message['role']}\n{message['content']}<|im_end|>\n"
formatted_prompt += (
f"<|im_start|>{message['role']}\n{message['content']}<|im_end|>\n"
)

formatted_prompt += f"<|im_start|>assistant\n"

Expand Down
Loading