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 vLLM backend for open weight model evaluation #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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

@@ -88,7 +88,7 @@ def get_runned_ids(file_path):
args = parser.parse_args()
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.

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.

1 participant