Skip to content

Commit cbdcdea

Browse files
committed
Add a few dtypes
1 parent a648319 commit cbdcdea

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/hub/src/lib/parse-safetensors-metadata.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,21 @@ class SafetensorParseError extends Error {}
4242
type FileName = string;
4343

4444
export type TensorName = string;
45-
export type Dtype = "F64" | "F32" | "F16" | "BF16" | "I64" | "I32" | "I16" | "I8" | "U8" | "BOOL";
45+
export type Dtype =
46+
| "F64"
47+
| "F32"
48+
| "F16"
49+
| "F8_E4M3"
50+
| "F8_E5M2"
51+
| "BF16"
52+
| "I64"
53+
| "I32"
54+
| "I16"
55+
| "I8"
56+
| "U16"
57+
| "U8"
58+
| "BOOL"
59+
| "UNK"; /// when the total_parameters is stored directly in the header, we use this dummy dtype
4660

4761
export interface TensorInfo {
4862
dtype: Dtype;

0 commit comments

Comments
 (0)