Build without on-device ML, arm64 only
Replace llamadart, flutter_onnxruntime and flutter_langdetect with API-compatible stubs via dependency_overrides, so llama.cpp, LiteRT-LM and ONNX Runtime are not packaged. Translation and the neural image codec become unavailable; both are off by default upstream. Also drop non-arm64 prebuilt plugin libraries at packaging time. APK: 340 MB -> 39.5 MB, flutter test 909/909 passing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3bee159c4f
commit
42e4a1e0de
9 files changed
+144
No files matched your search
@@ -0,0 +1,34 @@
|
||||
Never _unsupported() =>
|
||||
throw UnsupportedError('ONNX Runtime is not built in.');
|
||||
|
||||
class OnnxRuntime {
|
||||
Future<OrtSession> createSession(String path, {Object? options}) async =>
|
||||
_unsupported();
|
||||
}
|
||||
|
||||
class OrtSession {
|
||||
OrtSession._();
|
||||
|
||||
List<String> get inputNames => const <String>[];
|
||||
List<String> get outputNames => const <String>[];
|
||||
|
||||
Future<Map<String, OrtValue>> run(
|
||||
Map<String, OrtValue> inputs, {
|
||||
Object? options,
|
||||
}) async => _unsupported();
|
||||
|
||||
Future<void> close() async {}
|
||||
}
|
||||
|
||||
class OrtValue {
|
||||
OrtValue._();
|
||||
|
||||
static Future<OrtValue> fromList(Object data, List<int> shape) async =>
|
||||
_unsupported();
|
||||
|
||||
List<int> get shape => const <int>[];
|
||||
|
||||
Future<List<dynamic>> asFlattenedList() async => _unsupported();
|
||||
|
||||
Future<void> dispose() async {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
name: flutter_onnxruntime
|
||||
description: Stub without native code (meshcore-open tth fork).
|
||||
version: 1.9.0
|
||||
publish_to: none
|
||||
environment:
|
||||
sdk: ^3.9.2
|
||||
Reference in new issue
Block a user