from lmdeploy import pipeline, TurbomindEngineConfig
backend_config = TurbomindEngineConfig(tp=8,model_format='hf', session_len=4096,cache_max_entry_count=0.2)
model_path="/data2//open_model/llava-v1.6-vicuna-7b"
#模型路径是指模型文件所在的本地目录路径,或者是在huggingface.co上托管的模型仓库中的模型ID。
pipe = pipeline(model_path,backend_config=backend_config)
image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')
print("image",image)
response = pipe(('describe this image', image))
print("response",response.text)
分析得出是输入长度加上图片token过程,vicuna 默认的session_len长度(2048)过短造成的,对话模版也需要了解。