You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defread_safetensors_header(file: BytesIO) ->dict[str, dict[str, Any]]:
"""Read the header of a safetensors file. Args: file: The safetensors file to read. Returns: The header of the safetensors file. """header_size=struct.unpack_from("i", file.read(8))[0]
header=file.read(header_size)
returnjson.loads(header.decode("utf-8"))
Is there a way to access the header in Python to know the offsets of each tensor data?
The text was updated successfully, but these errors were encountered: