Skip to content

Commit

Permalink
[Bugfix] Fix new Llama3.1 GGUF model loading (vllm-project#7269)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isotr0py authored Aug 8, 2024
1 parent e904576 commit 8334c39
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions vllm/model_executor/model_loader/weight_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,23 +435,25 @@ def gguf_quant_weights_iterator(
reader = gguf.GGUFReader(gguf_file)

for tensor in reader.tensors:
weight_type = tensor.tensor_type
name = gguf_to_hf_name_map[tensor.name]
if tensor.name in gguf_to_hf_name_map:
weight_type = tensor.tensor_type
name = gguf_to_hf_name_map[tensor.name]

if weight_type.name != "F32":
weight_type_name = name.replace("weight", "qweight_type")
weight_type = torch.tensor(weight_type)
yield weight_type_name, weight_type
if weight_type.name != "F32":
weight_type_name = name.replace("weight", "qweight_type")
weight_type = torch.tensor(weight_type)
yield weight_type_name, weight_type

for tensor in reader.tensors:
weight = tensor.data
weight_type = tensor.tensor_type
name = gguf_to_hf_name_map[tensor.name]

if weight_type.name != "F32":
name = name.replace("weight", "qweight")
param = torch.tensor(weight)
yield name, param
if tensor.name in gguf_to_hf_name_map:
weight = tensor.data
weight_type = tensor.tensor_type
name = gguf_to_hf_name_map[tensor.name]

if weight_type.name != "F32":
name = name.replace("weight", "qweight")
param = torch.tensor(weight)
yield name, param


def kv_cache_scales_loader(
Expand Down

0 comments on commit 8334c39

Please sign in to comment.