From 39d1e05e1035942aceb38a6ce5eb87d60339c242 Mon Sep 17 00:00:00 2001 From: Vali-98 <137794480+Vali-98@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:43:46 +0800 Subject: [PATCH] fix(android): loadSession not taking paths with file:// (#66) --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e074bbd6..eabdebbc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,7 +75,9 @@ export class LlamaContext { * Load cached prompt & completion state from a file. */ async loadSession(filepath: string): Promise { - return RNLlama.loadSession(this.id, filepath) + let path = filepath + if (path.startsWith('file://')) path = path.slice(7) + return RNLlama.loadSession(this.id, path) } /**