Skip to content

Commit

Permalink
fix: loadSession not taking paths with file://
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Jul 20, 2024
1 parent 4c90a78 commit 6d3797f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class LlamaContext {
* Load cached prompt & completion state from a file.
*/
async loadSession(filepath: string): Promise<NativeSessionLoadResult> {
return RNLlama.loadSession(this.id, filepath)
let path = filepath
if (path.startsWith('file://')) path = path.slice(7)
return RNLlama.loadSession(this.id, path)
}

/**
Expand Down

0 comments on commit 6d3797f

Please sign in to comment.