-
Notifications
You must be signed in to change notification settings - Fork 658
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(venv): support pip options #1052
Conversation
For more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't ruff format be sufficient enough?
src/openllm/local.py
Outdated
venv = ensure_venv(bento) | ||
cmd, env, cwd = _get_serve_cmd(bento, port=port) | ||
output(f'Access the Chat UI at http://localhost:{port}/chat (or with you IP)') | ||
run_command(cmd, env=env, cwd=cwd, venv=venv) | ||
|
||
|
||
def prep_env_vars(bento: BentoInfo): | ||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move this to top of files.
Signed-off-by: Rick Zhou <rickzhoucmu@gmail.com>
Yeah, i realized the CI is already doing this. No need for black format |
For more information, see https://pre-commit.ci
@@ -16,6 +28,7 @@ def _get_serve_cmd(bento: BentoInfo, port: int = 3000): | |||
|
|||
|
|||
def serve(bento: BentoInfo, port: int = 3000): | |||
prep_env_vars(bento) | |||
venv = ensure_venv(bento) | |||
cmd, env, cwd = _get_serve_cmd(bento, port=port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the prepared env isn't applied to bentoml serve
? @rickzx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is applied to bentoml serve
. The run_command
function explicitly copies the env vars from the current process to the new process (even if it doesn't, the default subprocess will also inherit env from the current process)
requirements.txt
can have options likeblack