Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
commit bug fixes for client serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Friedowitz committed Apr 9, 2024
1 parent 706ac29 commit 2b65088
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lm-buddy"
version = "0.10.0"
version = "0.10.1"
authors = [
{ name = "Sean Friedowitz", email = "[email protected]" },
{ name = "Aaron Gonzales", email = "[email protected]" },
Expand Down
11 changes: 6 additions & 5 deletions src/lm_buddy/jobs/evaluation/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,8 @@ def get_response_with_retries(


def run_eval(config: PrometheusJobConfig) -> Path:
# Instantiate OpenAI client to speak with the vLLM endpoint
client = OpenAI(base_url=config.prometheus.inference.base_url)

hf_loader = HuggingFaceAssetLoader()

# Resolve the engine model
hf_loader = HuggingFaceAssetLoader()
engine_path = hf_loader.resolve_asset_path(config.prometheus.inference.engine)

# Load dataset from W&B artifact
Expand All @@ -135,6 +131,11 @@ def run_eval(config: PrometheusJobConfig) -> Path:

# Generator that iterates over samples and yields new rows with the prometheus outputs
def data_generator():
# Instantiate OpenAI client to speak with the vLLM endpoint
# Client is non-serializable so must be instantiated internal to this method
# Reference: https://huggingface.co/docs/datasets/en/troubleshoot#pickling-issues
client = OpenAI(base_url=config.prometheus.inference.base_url)

for sample in dataset_iterable:
# convert instructions from the dataset (`text_field` in a dict) to
# prompts that prometheus accepts
Expand Down

0 comments on commit 2b65088

Please sign in to comment.