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

enable run vlm with pytorch engine in gradio #2256

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lmdeploy/serve/gradio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def run(model_path_or_server: str,
pipeline_type, _ = get_task(model_path_or_server)
if pipeline_type == 'vlm':
from lmdeploy.serve.gradio.vl import run_local
assert backend == 'turbomind', 'vlm only support turbomind backend'
if backend_config is not None and \
backend_config.session_len is None:
backend_config.session_len = 8192
Expand Down
5 changes: 4 additions & 1 deletion lmdeploy/serve/gradio/vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def cancel(chatbot, session):

def reset(session):
"""Reset a new session."""
stop(session)
if session is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it a None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

press reset button before input anything, the session is None

session = Session()
else:
stop(session)
session._step = 0
session._message = []
return [], session, enable_btn
Expand Down
Loading