Skip to content

Commit 42f1811

Browse files
committed
fix: allow multiple weight mapping files for mistral
Downloading a Mistral model fails because it includes multiple weight mapping files. The regression was introduced in commit `766bee9f4a1fcb187fae543a525495d3ff482097`. I'm unclear on the original intent, but perhaps the exception was meant to apply only to Granite models. This isn’t an ideal fix, but it does enable Mistral to be downloaded and used for chat. Signed-off-by: Sébastien Han <seb@redhat.com>
1 parent 54455a3 commit 42f1811

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchchat/cli/convert_hf_checkpoint.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def convert_hf_checkpoint(
4343

4444
# Load the json file containing weight mapping
4545
model_map_json_matches = [Path(m) for m in glob.glob(str(model_dir / "*.index.json"))]
46-
assert len(model_map_json_matches) <= 1, "Found multiple weight mapping files"
46+
if "mistral" not in model_name:
47+
assert len(model_map_json_matches) <= 1, "Found multiple weight mapping files"
4748
if len(model_map_json_matches):
4849
model_map_json = model_map_json_matches[0]
4950
else:

0 commit comments

Comments
 (0)