Skip to content

Commit

Permalink
fix vl gradio
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc committed Sep 27, 2024
1 parent 4812b5a commit 8b20165
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lmdeploy/serve/gradio/vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from PIL import Image

from lmdeploy.messages import (GenerationConfig, PytorchEngineConfig,
TurbomindEngineConfig)
TurbomindEngineConfig, VisionConfig)
from lmdeploy.model import ChatTemplateConfig
from lmdeploy.pytorch.engine.request import _run_until_complete
from lmdeploy.serve.gradio.constants import CSS, THEME, disable_btn, enable_btn
Expand Down Expand Up @@ -70,12 +70,16 @@ def run_local(model_path: str,
**kwargs):

from lmdeploy.serve.vl_async_engine import VLAsyncEngine
if isinstance(backend_config, PytorchEngineConfig):
backend_config.thread_safe = True
vision_config = VisionConfig(thread_safe=True)
engine = VLAsyncEngine(model_path=model_path,
model_name=model_name,
backend=backend,
backend_config=backend_config,
chat_template_config=chat_template_config,
tp=tp,
vision_config=vision_config,
**kwargs)

def add_image(chatbot, session, file):
Expand Down

0 comments on commit 8b20165

Please sign in to comment.