Skip to content

Commit

Permalink
fix(ts): remove file:// prefix for lora param
Browse files Browse the repository at this point in the history
related #86
  • Loading branch information
jhen0409 committed Nov 16, 2024
1 parent 6190f57 commit da3e9a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,17 @@ export async function initLlama(
model,
is_model_asset: isModelAsset,
pooling_type: poolingType,
lora,
...rest
}: ContextParams,
onProgress?: (progress: number) => void,
): Promise<LlamaContext> {
let path = model
if (path.startsWith('file://')) path = path.slice(7)

let loraPath = lora
if (loraPath?.startsWith('file://')) loraPath = loraPath.slice(7)

const contextId = contextIdCounter + contextIdRandom()
contextIdCounter += 1

Expand All @@ -257,6 +262,7 @@ export async function initLlama(
is_model_asset: !!isModelAsset,
use_progress_callback: !!onProgress,
pooling_type: poolType,
lora: loraPath,
...rest,
}).catch((err: any) => {
removeProgressListener?.remove()
Expand Down

0 comments on commit da3e9a7

Please sign in to comment.