Skip to content

Commit 0ed0511

Browse files
andyxningjingyu
authored andcommitted
[Bugfix]: fix metadata file copy in test_sharded_state_loader (vllm-project#21830)
Signed-off-by: Andy Xie <[email protected]> Signed-off-by: jingyu <[email protected]>
1 parent fcd915a commit 0ed0511

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_sharded_state_loader.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4+
import fnmatch
45
import multiprocessing as mp
56
import os
67
import shutil
@@ -64,9 +65,10 @@ def _run_writer(input_dir, output_dir, weights_patterns, **kwargs):
6465
# Copy metadata files to output directory
6566
for file in os.listdir(input_dir):
6667
if os.path.isdir(os.path.join(input_dir, file)):
67-
continue
68-
if not any(file.endswith(ext) for ext in weights_patterns):
69-
shutil.copy(f"{input_dir}/{file}", output_dir)
68+
shutil.copytree(os.path.join(input_dir, file),
69+
os.path.join(output_dir, file))
70+
elif not any(fnmatch.fnmatch(file, ext) for ext in weights_patterns):
71+
shutil.copy(os.path.join(input_dir, file), output_dir)
7072

7173

7274
def _run_generate(input_dir, queue: mp.Queue, **kwargs):

0 commit comments

Comments
 (0)