Spaces:
Runtime error
Runtime error
Update demo/agent.py
Browse files- demo/agent.py +6 -3
demo/agent.py
CHANGED
@@ -5,7 +5,9 @@ from datetime import datetime
|
|
5 |
import gradio as gr
|
6 |
from PIL import Image
|
7 |
|
8 |
-
from lmdeploy import pipeline, TurbomindEngineConfig, GenerationConfig, ChatTemplateConfig
|
|
|
|
|
9 |
from lmdeploy.vl import load_image
|
10 |
|
11 |
class ConversationalAgent:
|
@@ -15,8 +17,9 @@ class ConversationalAgent:
|
|
15 |
self.pipe = pipeline(
|
16 |
model_path,
|
17 |
chat_template_config=ChatTemplateConfig(model_name='internvl2-internlm2'),
|
18 |
-
backend_config=TurbomindEngineConfig(session_len=8192),
|
19 |
-
|
|
|
20 |
device=self.device
|
21 |
)
|
22 |
|
|
|
5 |
import gradio as gr
|
6 |
from PIL import Image
|
7 |
|
8 |
+
# from lmdeploy import pipeline, TurbomindEngineConfig, GenerationConfig, ChatTemplateConfig
|
9 |
+
from lmdeploy import pipeline, GenerationConfig, ChatTemplateConfig
|
10 |
+
from lmdeploy.pytorch import PytorchEngineConfig
|
11 |
from lmdeploy.vl import load_image
|
12 |
|
13 |
class ConversationalAgent:
|
|
|
17 |
self.pipe = pipeline(
|
18 |
model_path,
|
19 |
chat_template_config=ChatTemplateConfig(model_name='internvl2-internlm2'),
|
20 |
+
# backend_config=TurbomindEngineConfig(session_len=8192),
|
21 |
+
|
22 |
+
backend_config=PytorchEngineConfig(max_length=8192),
|
23 |
device=self.device
|
24 |
)
|
25 |
|