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) } /**