Skip to content

Commit

Permalink
fix(android): loadSession not taking paths with file:// (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 authored Jul 22, 2024
1 parent 4c90a78 commit 39d1e05
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 39d1e05

Please sign in to comment.