Skip to content

Commit 68641fe

Browse files
committed
fix(models): fix method variable scope in quantization fallback
The method variable was declared inside the for loop, causing 'method is not defined' error when referenced after the loop. Moved declaration outside loop to fix scope issue. This allows the FP32 fallback to work correctly when INT4 quantization fails (e.g., on incompatible model architectures).
1 parent a196057 commit 68641fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/models/scripts/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ async function quantizeModel(modelKey) {
212212
: [{ input: 'model.onnx', output: 'model.int4.onnx' }]
213213

214214
const quantizedPaths = []
215+
let method = 'INT4'
215216

216217
for (const { input, output } of models) {
217218
const onnxPath = join(modelDir, input)
@@ -224,7 +225,6 @@ async function quantizeModel(modelKey) {
224225

225226
let originalSize
226227
let quantSize
227-
let method = 'INT4'
228228

229229
try {
230230
await execAsync(

0 commit comments

Comments
 (0)