mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
refactor(model): derive partial tensor schema from shared fields (#16649)
This commit is contained in:
1 parent
bc14d29a0e
commit
2db225c2fa
1 file changed
+6
-13
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user