Co-authored-by: Zhang, Mingxu <mingxu.zhang@intel.com> Co-authored-by: MingxuZh <109504044+MingxuZh@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
import unittest
|
|
|
|
import sglang as sgl
|
|
from sglang.srt.environ import envs
|
|
from sglang.test.ci.ci_register import (
|
|
register_amd_ci,
|
|
register_cpu_ci,
|
|
register_cuda_ci,
|
|
)
|
|
from sglang.test.test_utils import CustomTestCase
|
|
|
|
register_cuda_ci(est_time=29, stage="base-b", runner_config="1-gpu-small")
|
|
register_amd_ci(est_time=45, suite="stage-b-test-1-gpu-small-amd")
|
|
register_cpu_ci(est_time=32, suite="base-c-test-cpu")
|
|
|
|
|
|
class TestExternalModels(CustomTestCase):
|
|
def test_external_model(self):
|
|
envs.SGLANG_EXTERNAL_MODEL_PACKAGE.set("sglang.test.external_models")
|
|
envs.SGLANG_EXTERNAL_MM_PROCESSOR_PACKAGE.set("sglang.test.external_models")
|
|
prompt = "Today is a sunny day and I like"
|
|
model_path = "Qwen/Qwen2-VL-2B-Instruct"
|
|
|
|
engine = sgl.Engine(
|
|
model_path=model_path,
|
|
cuda_graph_max_bs_decode=1,
|
|
max_total_tokens=64,
|
|
enable_multimodal=True,
|
|
)
|
|
out = engine.generate(prompt)["text"]
|
|
engine.shutdown()
|
|
|
|
self.assertGreater(len(out), 0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|