Add flash attention

This commit is contained in:
Beingpax 2025-08-14 10:47:28 +05:45
parent 8d319aa99a
commit f909185eac

View File

@ -126,6 +126,10 @@ actor WhisperContext {
var params = whisper_context_default_params()
#if targetEnvironment(simulator)
params.use_gpu = false
logger.info("Running on the simulator, using CPU")
#else
params.flash_attn = true // Enable flash attention for Metal
logger.info("Flash attention enabled for Metal")
#endif
let context = whisper_init_from_file_with_params(path, params)