Huggingface.js documentation
Class: SafetensorParseError
Class: SafetensorParseError
Được ném ra khi tệp safetensors hoặc chỉ mục phân mảnh bị lỗi định dạng (header sai, mục tensor không hợp lệ, tên tệp phân mảnh không an toàn, …) thay vì lỗi khi truy xuất, để người gọi có thể coi sự cố này là vĩnh viễn — ví dụ: loại bỏ kết quả phân tích đã được lưu đệm thay vì giữ lại để thử lại.
Hệ thống phân cấp
Error↳
SafetensorParseError
Hàm khởi tạo
constructor
• new SafetensorParseError(message): SafetensorParseError
Tham số
| Tên | Loại |
|---|---|
message | string |
Trả về
Ghi đè
Error.constructor
Được định nghĩa trong
packages/hub/src/lib/parse-safetensors-metadata.ts:234
Thuộc tính
nguyên nhân
• nguyên nhân Optional: unknown
Kế thừa từ
Error.cause
Được định nghĩa trong
packages/doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
message
• message: string
Kế thừa từ
Error.message
Được định nghĩa trong
packages/doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077
name
• name: string
Kế thừa từ
Error.name
Được định nghĩa trong
packages/doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1076
stack
• stack Optional: string
Kế thừa từ
Error.stack
Được định nghĩa trong
packages/doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1078
prepareStackTrace
▪ Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any
Ghi đè tùy chọn cho việc định dạng vết chồng
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Khai báo kiểu
▸ (err, stackTraces): any
Tham số
| Tên | Loại |
|---|---|
err | Error |
stackTraces | CallSite[] |
Trả về
any
Kế thừa từ
Error.prepareStackTrace
Được định nghĩa trong
node_modules/.pnpm/@types+node@22.14.1/node_modules/@types/node/globals.d.ts:143
stackTraceLimit
▪ Static stackTraceLimit: number
Kế thừa từ
Error.stackTraceLimit
Được định nghĩa trong
node_modules/.pnpm/@types+node@22.14.1/node_modules/@types/node/globals.d.ts:145
Phương thức
captureStackTrace
▸ captureStackTrace(targetObject, constructorOpt?): void
Tạo thuộc tính .stack trên một đối tượng đích
Tham số
| Tên | Loại |
|---|---|
targetObject | object |
constructorOpt? | Function |
Trả về
void
Kế thừa từ
Error.captureStackTrace
Được định nghĩa trong
node_modules/.pnpm/@types+node@22.14.1/node_modules/@types/node/globals.d.ts:136
Update on GitHub