Skip to content

Add vLLM backend for open weight model evaluation#34

Open
lewtun wants to merge 1 commit intoSalesforceAIResearch:mainfrom
huggingface:add-vllm
Open

Add vLLM backend for open weight model evaluation#34
lewtun wants to merge 1 commit intoSalesforceAIResearch:mainfrom
huggingface:add-vllm

Conversation

@lewtun
Copy link

@lewtun lewtun commented Sep 4, 2024

This PR adds support for a vLLM backend so that Hugging Face models like Salesforce/xLAM-v0.1-r can be evaluated. I've shown how this works for WebShop and am happy to extend it to the other benchmarks if the API looks good to you.

@salesforce-cla
Copy link

salesforce-cla bot commented Sep 4, 2024

Thanks for the contribution! Before we can merge this, we need @lewtun to sign the Salesforce Inc. Contributor License Agreement.

class VllmChatModel(BaseLLM):
def __init__(self, llm_config: LLMConfig):
super().__init__(llm_config)
self.client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default endpoint in vLLM, but I could add it as an env variable if preferred

rewards = []
all_task_ids = list(range(0, 251))
REWARD_LOG_FILE = f"{args.llm}_{args.agent_arch}_results_webshop.csv"
REWARD_LOG_FILE = f"{args.llm.replace('/', '_')}_{args.agent_arch}_results_webshop.csv"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because Hugging Face model repos are in the form {org}/{repo_name} which causes problems when trying to write the file to disk.

Copy link
Contributor

@JimSalesforce JimSalesforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evaluate local model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments