Skip to content

Commit

Permalink
fix: run format
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <[email protected]>
  • Loading branch information
aarnphm committed Feb 7, 2025
1 parent 0db6ace commit aa65ad3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/openllm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ def normalized_envs(self) -> str:
return '\n'.join(f'{k}={v}' for k, v in sorted(self.envs.items(), key=lambda x: x[0]) if not v)

def __hash__(self): # type: ignore
return md5(
self.normalized_requirements_txt,
str(hash(self.normalized_envs)),
)
return md5(self.normalized_requirements_txt, str(hash(self.normalized_envs)))


class Accelerator(SimpleNamespace):
Expand Down
7 changes: 5 additions & 2 deletions src/openllm/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ def _resolve_bento_venv_spec(bento: BentoInfo, runtime_envs: Optional[EnvVars] =
bentofile = bento.path / 'bento.yaml'
data = yaml.safe_load(bentofile.read_text())
bento_env_list = data.get('envs', [])
python_version = data.get("image", {})['python_version']
python_version = data.get('image', {})['python_version']
bento_envs = {e['name']: e.get('value') for e in bento_env_list}
envs = {k: runtime_envs.get(k, v) for k, v in bento_envs.items()} if runtime_envs else {}

return VenvSpec(
python_version=python_version, requirements_txt=reqs, name_prefix=f'{bento.tag.replace(":", "_")}-1-', envs=EnvVars(envs)
python_version=python_version,
requirements_txt=reqs,
name_prefix=f'{bento.tag.replace(":", "_")}-1-',
envs=EnvVars(envs),
)


Expand Down

0 comments on commit aa65ad3

Please sign in to comment.