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

Function test_offline_model

tests/model_loader/test_offline_model.py:74–103  ·  view source on GitHub ↗
(
    fd_runner,
    model_name_or_path: str,
    tensor_parallel_size: int,
    max_num_seqs: int,
    max_model_len: int,
    max_tokens: int,
    quantization: str,
    env,
    monkeypatch,
)

Source from the content-addressed store, hash-verified

72 params,
73)
74def test_offline_model(
75 fd_runner,
76 model_name_or_path: str,
77 tensor_parallel_size: int,
78 max_num_seqs: int,
79 max_model_len: int,
80 max_tokens: int,
81 quantization: str,
82 env,
83 monkeypatch,
84) -> None:
85 torch_model_path = get_torch_model_path(model_name_or_path)
86 if env:
87 for k, v in env.items():
88 monkeypatch.setenv(k, v)
89
90 _ = run_with_timeout(
91 target=form_model_get_output_topp0,
92 args=(
93 fd_runner,
94 torch_model_path,
95 tensor_parallel_size,
96 max_num_seqs,
97 max_model_len,
98 max_tokens,
99 quantization,
100 "default_v1",
101 prompts,
102 ),
103 )

Callers

nothing calls this directly

Calls 3

get_torch_model_pathFunction · 0.90
run_with_timeoutFunction · 0.90
itemsMethod · 0.80

Tested by

no test coverage detected