Skip to content

Commit

Permalink
model_dir -> run_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Mar 12, 2024
1 parent 29ca3b7 commit aab83e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
container_idle_timeout=120,
)
class Inference:
def __init__(self, run_name: str = "", model_dir: str = "/runs") -> None:
def __init__(self, run_name: str = "", run_dir: str = "/runs") -> None:
self.run_name = run_name
self.model_dir = model_dir
self.run_dir = run_dir

@modal.enter()
def init(self):
if self.run_name:
run_name = self.run_name
else:
# Pick the last run automatically
run_name = VOLUME_CONFIG[self.model_dir].listdir("/")[-1].path
run_name = VOLUME_CONFIG[self.run_dir].listdir("/")[-1].path

# Grab the output dir (usually "lora-out")
with open(f"{self.model_dir}/{run_name}/config.yml") as f:
with open(f"{self.run_dir}/{run_name}/config.yml") as f:
output_dir = yaml.safe_load(f.read())["output_dir"]

model_path = f"{self.model_dir}/{run_name}/{output_dir}/merged"
model_path = f"{self.run_dir}/{run_name}/{output_dir}/merged"
print("Initializing vLLM engine on:", model_path)

from vllm.engine.arg_utils import AsyncEngineArgs
Expand Down

0 comments on commit aab83e5

Please sign in to comment.