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

feat(inference): add vLLM inference #19

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

maxreciprocate
Copy link
Collaborator

@maxreciprocate maxreciprocate commented Aug 30, 2023

This PR adds vLLM inference in data parallel manner by launching multiple local servers in view of tensor_parallel_size

Usage:

from autocrit.inference import vLLMHook
# setup servers
model = vLLMHook("meta-llama/Llama-2-7b-hf", tensor_parallel_size=1, num_external_nodes=8)
model.generate(["..."], temperature=1, stop=["</s>"])
# stop servers
model.free()

Usage for reward models:

from autocrit.inference import RewardHook
model = RewardHook("reciprocate/rm_beluga-7b_hh-full")
scores = model.score(["..."])
model.free()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants