alibaba / rtp-llm

RTP-LLM: Alibaba's high-performance LLM inference engine for diverse applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

按照官方示例 https://github.com/alibaba/rtp-llm/blob/main/docs/Multimodal-Tutorial.md 报错 maga_transformer.config.exceptions.FtRuntimeException: raw request format cannot accept dict prompt

samaritan1998 opened this issue · comments

使用的是qwen-vl
import os
from maga_transformer.pipeline import Pipeline
from maga_transformer.model_factory import ModelFactory, ModelConfig
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
model = ModelFactory.from_huggingface("/checkpoint/path/")
pipeline = Pipeline(model, model.tokenizer)
generate_config = {
"top_k": 1,
"max_new_tokens": 100
}

for res in pipeline(["Picture 1:\n这是什么"], images = [["https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"]], generate_config = generate_config):
print(res.batch_response)

pipeline.stop()

这个接口现在改成了 https://github.com/alibaba/rtp-llm/blob/796698a8a28f7f964e959ba6e0893014831d4348/maga_transformer/pipeline/pipeline.py#L73C1-L76C63
即直接传入prompt: str 和 image: List[str]
稍后会更新文档