Skip to content

Commit 408f509

Browse files
[BFCL] Using model_name attribute (#1195)
Standardize and make use of the `model_name` attribute in `model_config.py` to indicate the name of the model as used in the vendor API or on Hugging Face (may not be unique). This avoids any further processing within each handler (eg, `self.model_name.replace("-FC", "")`). --------- Co-authored-by: Huanzhi Mao <[email protected]>
1 parent b55cb88 commit 408f509

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+721
-250
lines changed

berkeley-function-call-leaderboard/bfcl_eval/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ SERPAPI_API_KEY=
33

44
# Provide the API key for the model(s) you intend to use
55
OPENAI_API_KEY=sk-XXXXXX
6+
OPENAI_DEFAULT_HEADERS=
7+
OPENAI_BASE_URL=
8+
69
ANTHROPIC_API_KEY=
710
# We use Google AI Studio to inference Google Gemini models
811
GOOGLE_API_KEY=

berkeley-function-call-leaderboard/bfcl_eval/_llm_response_generation.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ def get_args():
6464

6565
def build_handler(model_name, temperature):
6666
config = MODEL_CONFIG_MAPPING[model_name]
67-
handler = config.model_handler(model_name, temperature)
68-
# Propagate config flags to the handler instance
69-
handler.is_fc_model = config.is_fc_model
67+
handler = config.model_handler(
68+
model_name=config.model_name,
69+
temperature=temperature,
70+
registry_name=model_name,
71+
is_fc_model=config.is_fc_model,
72+
)
7073
return handler
7174

7275

@@ -206,7 +209,11 @@ def generate_results(args, model_name, test_cases_total):
206209
is_oss_model = True
207210
# For OSS models, if the user didn't explicitly set the number of threads,
208211
# we default to 100 threads to speed up the inference.
209-
num_threads = args.num_threads if args.num_threads is not None else LOCAL_SERVER_MAX_CONCURRENT_REQUEST
212+
num_threads = (
213+
args.num_threads
214+
if args.num_threads is not None
215+
else LOCAL_SERVER_MAX_CONCURRENT_REQUEST
216+
)
210217
else:
211218
handler: BaseHandler
212219
is_oss_model = False

0 commit comments

Comments
 (0)