mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-04-24 11:18:58 +02:00
coreml : wrap inference call in @autoreleasepool to fix memory leak (#1218)
This commit is contained in:
parent
8e46ba80d3
commit
18e9889418
@ -53,10 +53,12 @@ void whisper_coreml_encode(
|
|||||||
error: nil
|
error: nil
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@autoreleasepool {
|
||||||
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
|
whisper_encoder_implOutput * outCoreML = [(__bridge id) ctx->data predictionFromLogmel_data:inMultiArray error:nil];
|
||||||
|
|
||||||
memcpy(out, outCoreML.output.dataPointer, outCoreML.output.count * sizeof(float));
|
memcpy(out, outCoreML.output.dataPointer, outCoreML.output.count * sizeof(float));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user