From da3e9a79608b9def6d3421db9e4bed3a939f57d0 Mon Sep 17 00:00:00 2001 From: Jhen-Jie Hong Date: Sat, 16 Nov 2024 18:53:03 +0800 Subject: [PATCH] fix(ts): remove file:// prefix for lora param related #86 --- src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.ts b/src/index.ts index 3e9d46a..22ba726 100644 --- a/src/index.ts +++ b/src/index.ts @@ -227,12 +227,17 @@ export async function initLlama( model, is_model_asset: isModelAsset, pooling_type: poolingType, + lora, ...rest }: ContextParams, onProgress?: (progress: number) => void, ): Promise { 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 @@ -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()