Skip to content

Commit

Permalink
[Convert] Fix Qwen convert issue. (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-Yu authored and Duyi-Wang committed Apr 15, 2024
1 parent e91e75d commit 62994fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xfastertransformer/tools/qwen_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def split_and_convert(self, input_dir, output_dir, dtype, processes):
from typing import TYPE_CHECKING, Any, Callable, ContextManager, Iterator, Sequence, TypeVar, cast

def _get_name_and_param(model_dir: Path):
num_parts = 82
all_files = os.listdir(model_dir)
safetensors_files = [f for f in all_files if f.endswith('.safetensors')]
num_parts = len(safetensors_files)
for part_name in (f"model-{n:05}-of-{num_parts:05}.safetensors" for n in range(1, num_parts + 1)):
ctx: ContextManager[Any]
from safetensors import safe_open
Expand Down

0 comments on commit 62994fa

Please sign in to comment.