Fix GGUF metadata reading for falcon
This commit is contained in:
parent
9331ab4798
commit
78811dd89a
1 changed files with 5 additions and 1 deletions
|
@ -50,7 +50,11 @@ value_type_info = {
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue