ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

Batch inference

Open VietDunghacker opened this issue 1 year ago • 4 comments

How to perform batch inference with swift? I don't see it mentioned anywhere in the docs and I cannot find it in the code either.

VietDunghacker avatar Jul 03 '24 06:07 VietDunghacker

Using the infer_backend vllm allows for batch inference.

https://github.com/modelscope/swift/blob/main/docs/source/LLM/VLLM%E6%8E%A8%E7%90%86%E5%8A%A0%E9%80%9F%E4%B8%8E%E9%83%A8%E7%BD%B2.md

The "inference_vllm" can take a "request_list" as input.

Jintao-Huang avatar Jul 03 '24 07:07 Jintao-Huang

Thank you.

VietDunghacker avatar Jul 03 '24 08:07 VietDunghacker

@Jintao-Huang vllm is great, but unfortunately vllm does not support all models in this repo. For instance, Phi-3 Vision is supported in their Github repo but not in the official pip version. I really think it will be helpful if the feature is implemented natively in swift instead of relying on vllm.

VietDunghacker avatar Jul 03 '24 16:07 VietDunghacker

Thanks for you suggestion! We have added batch inference for pytorch native to our todo list. This requirement will be accomplished in one sprint

tastelikefeet avatar Jul 09 '24 03:07 tastelikefeet

Using the infer_backend vllm allows for batch inference.

https://github.com/modelscope/swift/blob/main/docs/source/LLM/VLLM%E6%8E%A8%E7%90%86%E5%8A%A0%E9%80%9F%E4%B8%8E%E9%83%A8%E7%BD%B2.md

The "inference_vllm" can take a "request_list" as input.

hello, @Jintao-Huang , the page is not found

gouqi666 avatar Jan 09 '25 03:01 gouqi666

supported

https://swift.readthedocs.io/zh-cn/latest/Instruction/%E6%8E%A8%E7%90%86%E5%92%8C%E9%83%A8%E7%BD%B2.html

Jintao-Huang avatar Feb 28 '25 09:02 Jintao-Huang