Skip to content

Commit

Permalink
gguf-py : fix tensor groups for encoder-decoder models in gguf-dump.py (
Browse files Browse the repository at this point in the history
#8090)

Co-authored-by: Stanisław Szymczyk <[email protected]>
Co-authored-by: Brian <[email protected]>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent 9a590c8 commit d62e4aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gguf-py/scripts/gguf-dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ def translate_tensor_name(name):
'ssm_d': 'State space model skip connection',
'ssm_dt': 'State space model time step',
'ssm_out': 'State space model output projection',
'blk': 'Block'
'blk': 'Block',
'enc': 'Encoder',
'dec': 'Decoder',
}

expanded_words = []
Expand Down Expand Up @@ -291,6 +293,10 @@ def dump_markdown_metadata(reader: GGUFReader, args: argparse.Namespace) -> None
tensor_group_name = "base"
if tensor_components[0] == 'blk':
tensor_group_name = f"{tensor_components[0]}.{tensor_components[1]}"
elif tensor_components[0] in ['enc', 'dec'] and tensor_components[1] == 'blk':
tensor_group_name = f"{tensor_components[0]}.{tensor_components[1]}.{tensor_components[2]}"
elif tensor_components[0] in ['enc', 'dec']:
tensor_group_name = f"{tensor_components[0]}"

# Check if new Tensor Group
if tensor_group_name not in tensor_groups:
Expand Down

0 comments on commit d62e4aa

Please sign in to comment.