Skip to content
Merged
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
16 changes: 8 additions & 8 deletions berkeley-function-call-leaderboard/model_handler/handler_map.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from model_handler.gorilla_handler import GorillaHandler
from model_handler.gpt_handler import OpenAIHandler
from model_handler.claude_fc_handler import ClaudeFCHandler
from model_handler.claude_prompt_handler import ClaudePromptingHandler
from model_handler.mistral_handler import MistralHandler
from model_handler.databricks_handler import DatabricksHandler
from model_handler.deepseek_handler import DeepseekHandler
from model_handler.firework_ai_handler import FireworkAIHandler
from model_handler.nexus_handler import NexusHandler
from model_handler.functionary_handler import FunctionaryHandler
from model_handler.gemini_handler import GeminiHandler
from model_handler.oss_handler import OSSHandler
from model_handler.gemma_handler import GemmaHandler
from model_handler.glaive_handler import GlaiveHandler
from model_handler.deepseek_handler import DeepseekHandler
from model_handler.functionary_handler import FunctionaryHandler
from model_handler.databricks_handler import DatabricksHandler
from model_handler.gorilla_handler import GorillaHandler
from model_handler.gpt_handler import OpenAIHandler
from model_handler.hermes_handler import HermesHandler
from model_handler.mistral_handler import MistralHandler
from model_handler.nexus_handler import NexusHandler
from model_handler.oss_handler import OSSHandler

handler_map = {
"gorilla-openfunctions-v0": GorillaHandler,
Expand Down
11 changes: 8 additions & 3 deletions berkeley-function-call-leaderboard/model_handler/oss_handler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import json
import os

import ray
import shortuuid
import torch
from eval_checker.eval_runner_constant import FILENAME_INDEX_MAPPING
from model_handler.handler import BaseHandler
from model_handler.model_style import ModelStyle
from model_handler.utils import (
ast_parse,
augment_prompt_by_languge,
language_specific_pre_processing,
)
from eval_checker.eval_runner_constant import FILENAME_INDEX_MAPPING
import shortuuid, ray, os, json, torch


class OSSHandler(BaseHandler):
Expand All @@ -18,7 +23,7 @@ def __init__(self, model_name, temperature=0.7, top_p=1, max_tokens=1000) -> Non
def _init_model(self):
ray.init(ignore_reinit_error=True, num_cpus=8)

def _format_prompt(prompt, function):
def _format_prompt(prompt, function, test_category):
SYSTEM_PROMPT = """
You are an helpful assistant who has access to the following functions to help the user, you can use the functions if needed-
"""
Expand Down