From 5fe4a8724cb5f0e758ef7fb2f39cd8f9247ba836 Mon Sep 17 00:00:00 2001 From: "Huanzhi (Hans) Mao" Date: Fri, 3 Jan 2025 13:40:43 +0800 Subject: [PATCH] [BFCL] Rename Directories: `proprietary_model`->`api_inference`, `oss_model`->`local_inference` for Better Clarity (#859) Address #856 The folder names `oss_model` and `proprietary_model` within the `model_handler` directory are updated to better reflect their actual purpose. The current naming is misleading, as there are open-source model handlers located in the proprietary_model folder, which causes confusion. Updating these names will improve clarity and maintain logical organization. --- .../CONTRIBUTING.md | 6 +- berkeley-function-call-leaderboard/README.md | 2 +- .../{oss_model => api_inference}/__init__.py | 0 .../claude.py | 0 .../cohere.py | 0 .../databricks.py | 2 +- .../deepseek.py | 2 +- .../fireworks.py | 2 +- .../functionary.py | 2 +- .../gemini.py | 0 .../gogoagent.py | 2 +- .../gorilla.py | 0 .../grok.py | 2 +- .../mistral.py | 0 .../nexus.py | 0 .../nova.py | 0 .../nvidia.py | 2 +- .../openai.py | 0 .../writer.py | 2 +- .../yi.py | 0 .../bfcl/model_handler/handler_map.py | 66 +++++++++---------- .../__init__.py | 0 .../base_oss_handler.py | 2 +- .../constant.py | 0 .../deepseek.py | 2 +- .../deepseek_coder.py | 2 +- .../{oss_model => local_inference}/gemma.py | 2 +- .../{oss_model => local_inference}/glaive.py | 2 +- .../{oss_model => local_inference}/glm.py | 2 +- .../{oss_model => local_inference}/granite.py | 2 +- .../{oss_model => local_inference}/hammer.py | 2 +- .../{oss_model => local_inference}/hermes.py | 2 +- .../{oss_model => local_inference}/llama.py | 2 +- .../llama_fc.py | 2 +- .../{oss_model => local_inference}/minicpm.py | 2 +- .../minicpm_fc.py | 2 +- .../mistral_fc.py | 2 +- .../{oss_model => local_inference}/phi.py | 2 +- .../{oss_model => local_inference}/qwen.py | 2 +- .../salesforce.py | 4 +- 40 files changed, 63 insertions(+), 63 deletions(-) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => api_inference}/__init__.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/claude.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/cohere.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/databricks.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/deepseek.py (96%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/fireworks.py (98%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/functionary.py (86%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/gemini.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/gogoagent.py (83%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/gorilla.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/grok.py (83%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/mistral.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/nexus.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/nova.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/nvidia.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/openai.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/writer.py (94%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => api_inference}/yi.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{proprietary_model => local_inference}/__init__.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/base_oss_handler.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/constant.py (100%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/deepseek.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/deepseek_coder.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/gemma.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/glaive.py (94%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/glm.py (98%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/granite.py (98%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/hammer.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/hermes.py (98%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/llama.py (91%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/llama_fc.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/minicpm.py (91%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/minicpm_fc.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/mistral_fc.py (99%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/phi.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/qwen.py (97%) rename berkeley-function-call-leaderboard/bfcl/model_handler/{oss_model => local_inference}/salesforce.py (98%) diff --git a/berkeley-function-call-leaderboard/CONTRIBUTING.md b/berkeley-function-call-leaderboard/CONTRIBUTING.md index 1d0cb72af..4039c213d 100644 --- a/berkeley-function-call-leaderboard/CONTRIBUTING.md +++ b/berkeley-function-call-leaderboard/CONTRIBUTING.md @@ -23,12 +23,12 @@ berkeley-function-call-leaderboard/ │ │ ├── executable_eval/ # Evaluation by execution │ │ ├── multi_turn_eval/ # Multi-turn evaluation │ ├── model_handler/ # All model-specific handlers -│ │ ├── oss_model/ # Handlers for locally-hosted models +│ │ ├── local_inference/ # Handlers for locally-hosted models │ │ │ ├── base_oss_handler.py # Base handler for OSS models │ │ │ ├── llama_fc.py # Example: LLaMA (FC mode) │ │ │ ├── deepseek_coder.py # Example: DeepSeek Coder │ │ │ ├── ... -│ │ ├── proprietary_model/ # Handlers for API-based models +│ │ ├── api_inference/ # Handlers for API-based models │ │ │ ├── openai.py # Example: OpenAI models │ │ │ ├── claude.py # Example: Claude models │ │ │ ├── ... @@ -46,7 +46,7 @@ To add a new model, focus primarily on the `model_handler` directory. You do not ## Where to Begin - **Base Handler:** Start by reviewing `bfcl/model_handler/base_handler.py`. All model handlers inherit from this base class. The `inference_single_turn` and `inference_multi_turn` methods defined there are helpful for understanding the model response generation pipeline. The `base_handler.py` contains many useful details in the docstrings of each abstract method, so be sure to review them. - - If your model is hosted locally, you should also look at `bfcl/model_handler/oss_model/base_oss_handler.py`. + - If your model is hosted locally, you should also look at `bfcl/model_handler/local_inference/base_oss_handler.py`. - **Reference Handlers:** Checkout some of the existing model handlers (such as `openai.py`, `claude.py`, etc); you can likely reuse some of the existing code if your new model outputs in a similar format. - If your model is OpenAI-compatible, the `openai.py` handler will be helpful (and you might be able to just use it as is). - If your model is locally hosted, the `llama_fc.py` handler or the `deepseek_coder.py` handler can be good starting points. diff --git a/berkeley-function-call-leaderboard/README.md b/berkeley-function-call-leaderboard/README.md index 5cc7e3974..4b4ca59af 100644 --- a/berkeley-function-call-leaderboard/README.md +++ b/berkeley-function-call-leaderboard/README.md @@ -228,7 +228,7 @@ When specifying multiple models or test categories, separate them with **spaces* We welcome contributions! To add a new model: -1. Review `bfcl/model_handler/base_handler.py` and/or `bfcl/model_handler/oss_model/base_oss_handler.py` (if your model is hosted locally). +1. Review `bfcl/model_handler/base_handler.py` and/or `bfcl/model_handler/local_inference/base_oss_handler.py` (if your model is hosted locally). 2. Implement a new handler class for your model. 3. Update `bfcl/model_handler/handler_map.py` and `bfcl/eval_checker/model_metadata.py`. 4. Submit a Pull Request. diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/__init__.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/__init__.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/__init__.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/__init__.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/claude.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/claude.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/claude.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/claude.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/cohere.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/cohere.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/cohere.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/cohere.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/databricks.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/databricks.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/databricks.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/databricks.py index 01315e932..19b71037c 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/databricks.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/databricks.py @@ -2,7 +2,7 @@ import re import time -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from bfcl.model_handler.model_style import ModelStyle from bfcl.model_handler.utils import ( ast_parse, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/deepseek.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/deepseek.py similarity index 96% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/deepseek.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/deepseek.py index 696d7cee4..b8c6beed3 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/deepseek.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/deepseek.py @@ -2,7 +2,7 @@ import time from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from bfcl.model_handler.utils import retry_with_backoff from openai import OpenAI, RateLimitError from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/fireworks.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/fireworks.py similarity index 98% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/fireworks.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/fireworks.py index 22d1af2cd..4897ef436 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/fireworks.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/fireworks.py @@ -2,7 +2,7 @@ import time from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from openai import OpenAI diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/functionary.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/functionary.py similarity index 86% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/functionary.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/functionary.py index 8b630feba..e4fb95e88 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/functionary.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/functionary.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from bfcl.model_handler.model_style import ModelStyle from openai import OpenAI diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gemini.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gemini.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gemini.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gemini.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gogoagent.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gogoagent.py similarity index 83% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gogoagent.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gogoagent.py index dd58eb7a9..e4f23f313 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gogoagent.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gogoagent.py @@ -1,6 +1,6 @@ import os -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from openai import OpenAI diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gorilla.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gorilla.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/gorilla.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/gorilla.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/grok.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/grok.py similarity index 83% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/grok.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/grok.py index 296c43a99..857b4ddd0 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/grok.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/grok.py @@ -1,6 +1,6 @@ import os -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from openai import OpenAI diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/mistral.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/mistral.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/mistral.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/mistral.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nexus.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nexus.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nexus.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nexus.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nova.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nova.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nova.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nova.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nvidia.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nvidia.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nvidia.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nvidia.py index d5276c4e4..424c59602 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/nvidia.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/nvidia.py @@ -1,7 +1,7 @@ import os from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from bfcl.model_handler.utils import ( ast_parse, combine_consecutive_user_prompts, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/openai.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/openai.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/openai.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/openai.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/writer.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/writer.py similarity index 94% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/writer.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/writer.py index ebd7edf2a..83cb16733 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/writer.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/writer.py @@ -2,7 +2,7 @@ import time from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler from writerai import Writer diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/yi.py b/berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/yi.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/yi.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/api_inference/yi.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/handler_map.py b/berkeley-function-call-leaderboard/bfcl/model_handler/handler_map.py index 90a0c3308..96bc92603 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/handler_map.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/handler_map.py @@ -1,36 +1,36 @@ -from bfcl.model_handler.oss_model.deepseek import DeepseekHandler -from bfcl.model_handler.oss_model.deepseek_coder import DeepseekCoderHandler -from bfcl.model_handler.oss_model.gemma import GemmaHandler -from bfcl.model_handler.oss_model.glaive import GlaiveHandler -from bfcl.model_handler.oss_model.glm import GLMHandler -from bfcl.model_handler.oss_model.granite import GraniteHandler -from bfcl.model_handler.oss_model.hammer import HammerHandler -from bfcl.model_handler.oss_model.hermes import HermesHandler -from bfcl.model_handler.oss_model.llama import LlamaHandler -from bfcl.model_handler.oss_model.llama_fc import LlamaFCHandler -from bfcl.model_handler.oss_model.minicpm import MiniCPMHandler -from bfcl.model_handler.oss_model.minicpm_fc import MiniCPMFCHandler -from bfcl.model_handler.oss_model.mistral_fc import MistralFCHandler -from bfcl.model_handler.oss_model.phi import PhiHandler -from bfcl.model_handler.oss_model.qwen import QwenHandler -from bfcl.model_handler.oss_model.salesforce import SalesforceHandler -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 -from bfcl.model_handler.proprietary_model.deepseek import DeepSeekAPIHandler -from bfcl.model_handler.proprietary_model.fireworks import FireworksHandler -from bfcl.model_handler.proprietary_model.functionary import FunctionaryHandler -from bfcl.model_handler.proprietary_model.gemini import GeminiHandler -from bfcl.model_handler.proprietary_model.gogoagent import GoGoAgentHandler -from bfcl.model_handler.proprietary_model.gorilla import GorillaHandler -from bfcl.model_handler.proprietary_model.grok import GrokHandler -from bfcl.model_handler.proprietary_model.mistral import MistralHandler -from bfcl.model_handler.proprietary_model.nexus import NexusHandler -from bfcl.model_handler.proprietary_model.nova import NovaHandler -from bfcl.model_handler.proprietary_model.nvidia import NvidiaHandler -from bfcl.model_handler.proprietary_model.openai import OpenAIHandler -from bfcl.model_handler.proprietary_model.writer import WriterHandler -from bfcl.model_handler.proprietary_model.yi import YiHandler +from bfcl.model_handler.api_inference.claude import ClaudeHandler +from bfcl.model_handler.api_inference.cohere import CohereHandler +from bfcl.model_handler.api_inference.databricks import DatabricksHandler +from bfcl.model_handler.api_inference.deepseek import DeepSeekAPIHandler +from bfcl.model_handler.api_inference.fireworks import FireworksHandler +from bfcl.model_handler.api_inference.functionary import FunctionaryHandler +from bfcl.model_handler.api_inference.gemini import GeminiHandler +from bfcl.model_handler.api_inference.gogoagent import GoGoAgentHandler +from bfcl.model_handler.api_inference.gorilla import GorillaHandler +from bfcl.model_handler.api_inference.grok import GrokHandler +from bfcl.model_handler.api_inference.mistral import MistralHandler +from bfcl.model_handler.api_inference.nexus import NexusHandler +from bfcl.model_handler.api_inference.nova import NovaHandler +from bfcl.model_handler.api_inference.nvidia import NvidiaHandler +from bfcl.model_handler.api_inference.openai import OpenAIHandler +from bfcl.model_handler.api_inference.writer import WriterHandler +from bfcl.model_handler.api_inference.yi import YiHandler +from bfcl.model_handler.local_inference.deepseek import DeepseekHandler +from bfcl.model_handler.local_inference.deepseek_coder import DeepseekCoderHandler +from bfcl.model_handler.local_inference.gemma import GemmaHandler +from bfcl.model_handler.local_inference.glaive import GlaiveHandler +from bfcl.model_handler.local_inference.glm import GLMHandler +from bfcl.model_handler.local_inference.granite import GraniteHandler +from bfcl.model_handler.local_inference.hammer import HammerHandler +from bfcl.model_handler.local_inference.hermes import HermesHandler +from bfcl.model_handler.local_inference.llama import LlamaHandler +from bfcl.model_handler.local_inference.llama_fc import LlamaFCHandler +from bfcl.model_handler.local_inference.minicpm import MiniCPMHandler +from bfcl.model_handler.local_inference.minicpm_fc import MiniCPMFCHandler +from bfcl.model_handler.local_inference.mistral_fc import MistralFCHandler +from bfcl.model_handler.local_inference.phi import PhiHandler +from bfcl.model_handler.local_inference.qwen import QwenHandler +from bfcl.model_handler.local_inference.salesforce import SalesforceHandler # TODO: Add meta-llama/Llama-3.1-405B-Instruct diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/__init__.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/__init__.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/proprietary_model/__init__.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/__init__.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/base_oss_handler.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/base_oss_handler.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/base_oss_handler.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/base_oss_handler.py index 99b626568..87b400071 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/base_oss_handler.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/base_oss_handler.py @@ -7,7 +7,7 @@ from bfcl.constant import RESULT_PATH, VERSION_PREFIX from bfcl.model_handler.base_handler import BaseHandler from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.oss_model.constant import VLLM_PORT +from bfcl.model_handler.local_inference.constant import VLLM_PORT from bfcl.model_handler.utils import ( default_decode_ast_prompting, default_decode_execute_prompting, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/constant.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/constant.py similarity index 100% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/constant.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/constant.py diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek.py index 9e6c062ba..0a29122cb 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek_coder.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek_coder.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek_coder.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek_coder.py index dd33139a1..e193889a1 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/deepseek_coder.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/deepseek_coder.py @@ -1,7 +1,7 @@ import json import re -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( combine_consecutive_user_prompts, convert_system_prompt_into_user_prompt, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/gemma.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/gemma.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/gemma.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/gemma.py index 0f17e33d7..fee9c75e5 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/gemma.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/gemma.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( combine_consecutive_user_prompts, convert_system_prompt_into_user_prompt, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glaive.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glaive.py similarity index 94% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glaive.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glaive.py index 9cf358a70..e85b6a10c 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glaive.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glaive.py @@ -1,6 +1,6 @@ import json -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import convert_to_function_call from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glm.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glm.py similarity index 98% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glm.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glm.py index 72c450556..5792aff57 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/glm.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/glm.py @@ -2,7 +2,7 @@ from bfcl.model_handler.constant import GORILLA_TO_OPENAPI from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_to_function_call, convert_to_tool, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/granite.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/granite.py similarity index 98% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/granite.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/granite.py index 4b2ce6658..93455ba87 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/granite.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/granite.py @@ -2,7 +2,7 @@ from bfcl.model_handler.constant import GORILLA_TO_OPENAPI from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_to_tool, func_doc_language_specific_pre_processing, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hammer.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hammer.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hammer.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hammer.py index 87a268239..a4bd9caea 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hammer.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hammer.py @@ -1,6 +1,6 @@ import json -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_system_prompt_into_user_prompt, func_doc_language_specific_pre_processing, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hermes.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hermes.py similarity index 98% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hermes.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hermes.py index 5f54fe049..1e66bed65 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/hermes.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/hermes.py @@ -3,7 +3,7 @@ from bfcl.model_handler.constant import GORILLA_TO_OPENAPI from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_to_tool, func_doc_language_specific_pre_processing, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama.py similarity index 91% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama.py index b14097be1..96ac93953 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama_fc.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama_fc.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama_fc.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama_fc.py index f659176b4..5cc5c2fa6 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/llama_fc.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/llama_fc.py @@ -1,6 +1,6 @@ import json -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import func_doc_language_specific_pre_processing from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm.py similarity index 91% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm.py index 6ef995f2d..cfe27e268 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm_fc.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm_fc.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm_fc.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm_fc.py index ab2b18302..4b79ea5c9 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/minicpm_fc.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/minicpm_fc.py @@ -4,7 +4,7 @@ import datamodel_code_generator from bfcl.model_handler.constant import GORILLA_TO_OPENAPI -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_to_tool, func_doc_language_specific_pre_processing, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/mistral_fc.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/mistral_fc.py similarity index 99% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/mistral_fc.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/mistral_fc.py index e29669713..bab9f6387 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/mistral_fc.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/mistral_fc.py @@ -2,7 +2,7 @@ import random import string -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( convert_to_function_call, func_doc_language_specific_pre_processing, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/phi.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/phi.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/phi.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/phi.py index 3bc963889..277141300 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/phi.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/phi.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from bfcl.model_handler.utils import ( combine_consecutive_user_prompts, convert_system_prompt_into_user_prompt, diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/qwen.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/qwen.py similarity index 97% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/qwen.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/qwen.py index f37d6f900..76ca83829 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/qwen.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/qwen.py @@ -1,4 +1,4 @@ -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler from overrides import override diff --git a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/salesforce.py b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/salesforce.py similarity index 98% rename from berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/salesforce.py rename to berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/salesforce.py index 8c5bb8fe5..479120100 100644 --- a/berkeley-function-call-leaderboard/bfcl/model_handler/oss_model/salesforce.py +++ b/berkeley-function-call-leaderboard/bfcl/model_handler/local_inference/salesforce.py @@ -2,8 +2,8 @@ import time from bfcl.model_handler.model_style import ModelStyle -from bfcl.model_handler.oss_model.base_oss_handler import OSSHandler -from bfcl.model_handler.oss_model.constant import VLLM_PORT +from bfcl.model_handler.local_inference.base_oss_handler import OSSHandler +from bfcl.model_handler.local_inference.constant import VLLM_PORT from openai import OpenAI from overrides import override