Skip to content

Commit

Permalink
Fix GGUF metadata reading for falcon
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Sep 11, 2023
1 parent 9331ab4 commit 78811dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/metadata_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class GGUFValueType(IntEnum):
def get_single(value_type, file):
if value_type == GGUFValueType.STRING:
value_length = struct.unpack("<Q", file.read(8))[0]
value = file.read(value_length).decode('utf-8')
value = file.read(value_length)
try:
value = value.decode('utf-8')
except:
pass
else:
type_str = _simple_value_packing.get(value_type)
bytes_length = value_type_info.get(value_type)
Expand Down

0 comments on commit 78811dd

Please sign in to comment.