Skip to content

Commit 98cbc59

Browse files
authored
Merge pull request #156 from DenisovAV/fix/embedding-xnnpack-crash
Fix iOS embedding crash on repeated inference (v0.11.16)
2 parents 5e0f23a + ae42475 commit 98cbc59

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.11.16
2+
- 🐛 **iOS Embeddings Fix**: Fix crash on repeated embedding inference (#155)
3+
14
## 0.11.15
25
- 🤖 **FunctionGemma Single-Turn Mode**: FunctionGemma now operates in single-turn mode by design (clears history after each response)
36
- 🐛 **Download Resume Fix**: Fixed model download resume after interruption

ios/Classes/EmbeddingModel.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ class EmbeddingModel {
5050
var options = Interpreter.Options()
5151
options.threadCount = 4 // Optimize for mobile performance
5252

53-
// Enable XNNPACK for native FP16 support on A11+ devices
54-
// This gives results matching Web LiteRT which also uses native FP16
55-
options.isXNNPackEnabled = true
53+
// XNNPACK disabled for embeddings - causes crashes on repeated inference
54+
// Speed difference is negligible (~30-80ms vs ~10-30ms with XNNPACK)
55+
// See: https://github.com/DenisovAV/flutter_gemma/issues/155
56+
options.isXNNPackEnabled = false
5657

5758
// Note: Select TF Ops should be automatically available when TensorFlowLiteSelectTfOps is linked
5859

ios/flutter_gemma.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'flutter_gemma'
7-
s.version = '0.11.15'
7+
s.version = '0.11.16'
88
s.summary = 'Flutter plugin for running Gemma AI models locally with Gemma 3 Nano support.'
99
s.description = <<-DESC
1010
The plugin allows running the Gemma AI model locally on a device from a Flutter application.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_gemma
22
description: "The plugin allows running the Gemma AI model locally on a device from a Flutter application. Includes support for Gemma 3 Nano models with optimized MediaPipe GenAI v0.10.24."
3-
version: 0.11.15
3+
version: 0.11.16
44
homepage: https://github.com/DenisovAV/flutter_gemma
55
repository: https://github.com/DenisovAV/flutter_gemma
66

0 commit comments

Comments
 (0)