Skip to content

Fix To Allow Android To Work Out Of The Box #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/src/llama.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'dart:math';

import 'package:ffi/ffi.dart';
Expand Down Expand Up @@ -38,7 +39,7 @@ class Llama {
int cursor = 0;

/// set llama.cpp library path
static String? libraryPath;
static String? libraryPath = Platform.isAndroid ? "libllama.so" : null;

/// Getter for the Llama library.
///
Expand Down Expand Up @@ -76,7 +77,7 @@ class Llama {
: modelParams = modelParams ?? ModelParams(),
contextParams = contextParams ?? ContextParams(),
samplingParams = samplingParams ?? SamplingParams() {
lib.llama_backend_init(false);
lib.llama_backend_init();
llama_model_params modelParams = this.modelParams.get();

Pointer<Char> char = modelPath.toNativeUtf8().cast<Char>();
Expand Down
Loading