From e2c5c3fe4f27df91bc0b99c1aa373622d1ee6488 Mon Sep 17 00:00:00 2001 From: "Gilad S." <7817232+giladgd@users.noreply.github.com> Date: Thu, 26 Dec 2024 05:20:20 +0200 Subject: [PATCH] fix: embedding context deadlock (#402) --- .github/workflows/build.yml | 3 ++- src/evaluator/LlamaModel/LlamaModel.ts | 9 +-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d9960d5..7f3da7a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,8 @@ jobs: - name: Download latest llama.cpp release env: CI: true - run: node ./dist/cli/cli.js source download --release latest --skipBuild --noBundle --noUsageExample --updateBinariesReleaseMetadataAndSaveGitBundle + # pinned to `b4291` temporarily until the Windows on Arm64 build is fixed + run: node ./dist/cli/cli.js source download --release b4291 --skipBuild --noBundle --noUsageExample --updateBinariesReleaseMetadataAndSaveGitBundle - name: Upload build artifact uses: actions/upload-artifact@v4 with: diff --git a/src/evaluator/LlamaModel/LlamaModel.ts b/src/evaluator/LlamaModel/LlamaModel.ts index a909166b..7b5d255b 100644 --- a/src/evaluator/LlamaModel/LlamaModel.ts +++ b/src/evaluator/LlamaModel/LlamaModel.ts @@ -517,14 +517,7 @@ export class LlamaModel { if (this._vocabOnly) throw new Error("Model is loaded in vocabOnly mode, so no context can be created"); - return await withLock(this._llama._memoryLock, LlamaLocks.loadToMemory, options.createSignal, async () => { - const preventDisposalHandle = this._backendModelDisposeGuard.createPreventDisposalHandle(); - try { - return await LlamaEmbeddingContext._create({_model: this}, options); - } finally { - preventDisposalHandle.dispose(); - } - }); + return await LlamaEmbeddingContext._create({_model: this}, options); } /**