Fix libei
Rolling release / release (push) Successful in 9m40s

This commit is contained in:
2026-09-12 11:07:40 -04:00
parent b8c60e4326
commit 5b7c2b3b6d
20 changed files with 671 additions and 79 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
import { acquireQvac, releaseQvac, loadAuxiliaryModel, qvacSdk, withQvacMaster } from './qvac-master.js';
import { acquireQvac, releaseQvac, loadAuxiliaryModel, qvacSdk, withQvacMaster, qvacBusy } from './qvac-master.js';
export class QvacPerception {
constructor({ model = process.env.JARVIS_OCR_MODEL || 'OCR_LATIN' } = {}) { this.model = model; this.modelId = null; }
async ocr(image) {
if (qvacBusy()) throw new Error('OCR skipped while the language model is answering');
await acquireQvac();
try {
this.modelId ||= await loadAuxiliaryModel(this.model, {});
+9
View File
@@ -127,6 +127,15 @@ export async function unloadAuxiliaryModel(modelId) {
export function releaseQvac() { ownerCount = Math.max(0, ownerCount - 1); }
export function qvacBusy() {
try {
const loaded = Agent.engine.getLoaded?.();
return Boolean(loaded && loaded.requestId);
} catch {
return false;
}
}
export async function closeQvac() {
if (ownerCount > 0) return;
for (const modelId of auxiliaryModels.values()) await unloadAuxiliaryModel(modelId).catch(() => {});