generated from KOLANICH/python_project_boilerplate.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsafetensors.schema.json
66 lines (66 loc) · 1.6 KB
/
safetensors.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "safetensors format header",
"description": "Describes the structure of all the tensors and their metadata",
"$defs": {
"size_t": {
"type": "integer",
"minimum": 0,
"maximum": 281474976710655,
"description": "A natural integer no more than 48 bits (current CPU limitation, not all 64 bits are used)"
},
"Tensor": {
"title": "Tensor",
"description": "Describes the structure of one tensor",
"type": "object",
"additionalProperties": false,
"properties": {
"dtype": {
"type": "string",
"pattern": "([UIF])(8|16|32|64|128|256)",
"description": "Type of the array. U - unsigned int, I - signed int, F - IEEE 754 floating-point. Number is the count of bits."
},
"shape": {
"type": "array",
"items": {
"$ref": "#/$defs/size_t",
"description": "Size of each dimension."
}
},
"data_offsets": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/size_t",
"description": "Start offset of the array. "
},
{
"$ref": "#/$defs/size_t",
"description": "End offset of the array. Equal to the previous item + array size."
}
]
}
},
"required": [
"data_offsets",
"dtype",
"shape"
]
},
"Metadata": {
"type": "object",
"additionalProperties": {"type": "string"},
"title": "Metadata"
}
},
"type": "object",
"properties": {
"__metadata__": {
"description": "Arbitrary metadata",
"$ref": "#/$defs/Metadata"
}
},
"additionalProperties": {
"$ref": "#/$defs/Tensor"
}
}