From 6d3797f4b400820c4dc9085c62f80126234d896b Mon Sep 17 00:00:00 2001 From: Rusyaidi Date: Sat, 20 Jul 2024 21:36:42 +0800 Subject: [PATCH] fix: loadSession not taking paths with file:// --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e074bbd..eabdebb 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) } /**