File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -231,9 +231,11 @@ export async function parseSafetensorsMetadata(
231231 return {
232232 sharded : false ,
233233 header,
234- ...( params . computeParametersCount && {
235- parameterCount : computeNumOfParamsByDtypeSingleFile ( header ) ,
236- } ) ,
234+ ...( params . computeParametersCount
235+ ? {
236+ parameterCount : computeNumOfParamsByDtypeSingleFile ( header ) ,
237+ }
238+ : undefined ) ,
237239 } ;
238240 } else if (
239241 ( params . path && RE_SAFETENSORS_INDEX_FILE . test ( params . path ) ) ||
@@ -244,9 +246,11 @@ export async function parseSafetensorsMetadata(
244246 sharded : true ,
245247 index,
246248 headers,
247- ...( params . computeParametersCount && {
248- parameterCount : computeNumOfParamsByDtypeSharded ( headers ) ,
249- } ) ,
249+ ...( params . computeParametersCount
250+ ? {
251+ parameterCount : computeNumOfParamsByDtypeSharded ( headers ) ,
252+ }
253+ : undefined ) ,
250254 } ;
251255 } else {
252256 throw new Error ( "model id does not seem to contain safetensors weights" ) ;
You can’t perform that action at this time.
0 commit comments