Skip to content

Commit 39d1e05

Browse files
authored
fix(android): loadSession not taking paths with file:// (#66)
1 parent 4c90a78 commit 39d1e05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export class LlamaContext {
7575
* Load cached prompt & completion state from a file.
7676
*/
7777
async loadSession(filepath: string): Promise<NativeSessionLoadResult> {
78-
return RNLlama.loadSession(this.id, filepath)
78+
let path = filepath
79+
if (path.startsWith('file://')) path = path.slice(7)
80+
return RNLlama.loadSession(this.id, path)
7981
}
8082

8183
/**

0 commit comments

Comments
 (0)