MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / llm

Function llm

tests/model_loader/test_w4a8_model.py:47–65  ·  view source on GitHub ↗

LLM测试夹具

(request)

Source from the content-addressed store, hash-verified

45
46@pytest.fixture(scope="module", params=models)
47def llm(request):
48 """LLM测试夹具"""
49 model_path = os.path.join(bash_path, request.param)
50 try:
51 port_index = models.index(request.param) % len(FD_ENGINE_QUEUE_PORTS)
52 llm_instance = LLM(
53 model=model_path,
54 tensor_parallel_size=1,
55 data_parallel_size=2,
56 max_model_len=8192,
57 num_gpu_blocks_override=1024,
58 engine_worker_queue_port=FD_ENGINE_QUEUE_PORTS[port_index],
59 cache_queue_port=FD_CACHE_QUEUE_PORTS[port_index],
60 load_choices="default",
61 enable_expert_parallel=True,
62 )
63 yield weakref.proxy(llm_instance)
64 except Exception as e:
65 assert False, f"LLM initialization failed: {e}"
66
67
68@pytest.mark.timeout(60)

Callers

nothing calls this directly

Calls 3

LLMClass · 0.90
joinMethod · 0.80
indexMethod · 0.80

Tested by

no test coverage detected