refactor(model): derive partial tensor schema from shared fields (#16649)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-04 15:59:49 +08:00
1 parent bc14d29a0e
commit 2db225c2fa
1 file changed
+6 -13
+6 -13
View File
@@ -88,19 +88,12 @@ export const modelArtifactObjectSchema = z.strictObject({
});
/** Facts proven before an interrupted model read reached final file identity checks. */
export const modelArtifactPartialTensorSchema = z.strictObject({
index: count,
name: z.string(),
type: z.string(),
type_id: count.nullable(),
shape: z.array(decimal),
data_offset: count,
file_offset: count.nullable(),
byte_length: count.nullable(),
parameter_count: decimal,
byte_length_state: z.enum(["derived", "declared", "unknown"]),
storage_validation: z.enum(["consistent", "unknown", "not-established"]),
...location,
export const modelArtifactPartialTensorSchema = modelTensorSchema.extend({
file_offset: modelTensorSchema.shape.file_offset.nullable(),
storage_validation: z.enum([
...modelTensorSchema.shape.storage_validation.options,
"not-established",
]),
});
export const modelArtifactPartialSchema = z.strictObject({