We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f2ad1e1 + b6386e3 commit 2253efeCopy full SHA for 2253efe
lib/src/llama.dart
@@ -1,5 +1,6 @@
1
import 'dart:convert';
2
import 'dart:ffi';
3
+import 'dart:io';
4
import 'dart:math';
5
6
import 'package:ffi/ffi.dart';
@@ -38,7 +39,7 @@ class Llama {
38
39
int cursor = 0;
40
41
/// set llama.cpp library path
- static String? libraryPath;
42
+ static String? libraryPath = Platform.isAndroid ? "libllama.so" : null;
43
44
/// Getter for the Llama library.
45
///
@@ -76,7 +77,7 @@ class Llama {
76
77
: modelParams = modelParams ?? ModelParams(),
78
contextParams = contextParams ?? ContextParams(),
79
samplingParams = samplingParams ?? SamplingParams() {
- lib.llama_backend_init(false);
80
+ lib.llama_backend_init();
81
llama_model_params modelParams = this.modelParams.get();
82
83
Pointer<Char> char = modelPath.toNativeUtf8().cast<Char>();
0 commit comments