Spaces:
Running
Running
chore: deploy Laya Tetris f4a43d5
Browse files- deploy-sha.txt +1 -1
- flutter_bootstrap.js +1 -1
- webgpu_bridge/llama_webgpu_bridge.js +58 -9
- webgpu_bridge/manifest.json +11 -11
- webgpu_bridge/sha256sums.txt +1 -1
deploy-sha.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
f4a43d5b88afaecb9378ca78f0cd8f2f7916250e
|
flutter_bootstrap.js
CHANGED
|
@@ -42,6 +42,6 @@ _flutter.buildConfig = {"engineRevision":"5d531788691ec3404cac0cee66ead4007b1773
|
|
| 42 |
|
| 43 |
_flutter.loader.load({
|
| 44 |
serviceWorkerSettings: {
|
| 45 |
-
serviceWorkerVersion: "
|
| 46 |
}
|
| 47 |
});
|
|
|
|
| 42 |
|
| 43 |
_flutter.loader.load({
|
| 44 |
serviceWorkerSettings: {
|
| 45 |
+
serviceWorkerVersion: "3715908120" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
|
| 46 |
}
|
| 47 |
});
|
webgpu_bridge/llama_webgpu_bridge.js
CHANGED
|
@@ -5189,7 +5189,15 @@ var LlamaWebGpuBridge = class {
|
|
| 5189 |
_isOperationCallbackCurrent(operation, proxy) {
|
| 5190 |
return this._isOperationCurrent(operation) && proxy === this._workerProxy;
|
| 5191 |
}
|
| 5192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5193 |
if (!proxy) {
|
| 5194 |
return;
|
| 5195 |
}
|
|
@@ -5204,7 +5212,13 @@ var LlamaWebGpuBridge = class {
|
|
| 5204 |
return;
|
| 5205 |
}
|
| 5206 |
try {
|
| 5207 |
-
Promise.resolve(proxy.call(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5208 |
});
|
| 5209 |
} catch (_) {
|
| 5210 |
}
|
|
@@ -5225,7 +5239,7 @@ var LlamaWebGpuBridge = class {
|
|
| 5225 |
proxies2.add(operation.workerProxy);
|
| 5226 |
}
|
| 5227 |
for (const proxy of proxies2) {
|
| 5228 |
-
this._sendWorkerCancel(proxy);
|
| 5229 |
}
|
| 5230 |
return;
|
| 5231 |
}
|
|
@@ -5244,7 +5258,7 @@ var LlamaWebGpuBridge = class {
|
|
| 5244 |
proxies.add(operation.workerProxy);
|
| 5245 |
}
|
| 5246 |
for (const proxy of proxies) {
|
| 5247 |
-
this._sendWorkerCancel(proxy);
|
| 5248 |
}
|
| 5249 |
const runtimes = new Set(operation.runtimes || []);
|
| 5250 |
if (operation.runtime) {
|
|
@@ -5751,6 +5765,10 @@ var LlamaWebGpuBridge = class {
|
|
| 5751 |
return true;
|
| 5752 |
} catch (error) {
|
| 5753 |
this._throwIfDisposed();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5754 |
this._emitBridgeWarn(
|
| 5755 |
`llamadart: multimodal worker setup failed once; restarting worker (${serializeWorkerError(error)}).`
|
| 5756 |
);
|
|
@@ -6227,18 +6245,22 @@ var LlamaWebGpuBridge = class {
|
|
| 6227 |
this._recordWorkerGeneration(operation, proxy);
|
| 6228 |
}
|
| 6229 |
const guardedEvent = typeof onEvent === "function" ? (event) => {
|
| 6230 |
-
if (!operation || this._isOperationCallbackCurrent(operation, proxy) || event.event === "usage" && proxy === this._workerProxy) {
|
| 6231 |
onEvent(event);
|
| 6232 |
}
|
| 6233 |
} : void 0;
|
| 6234 |
try {
|
| 6235 |
-
const
|
| 6236 |
method,
|
| 6237 |
args,
|
| 6238 |
guardedEvent,
|
| 6239 |
transferList,
|
| 6240 |
operation ? { operationId: operation.id, workerGeneration: operation.workerGeneration } : void 0
|
| 6241 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6242 |
if (response?.state) {
|
| 6243 |
this._acceptWorkerState(operation, proxy, response.state);
|
| 6244 |
}
|
|
@@ -6580,7 +6602,7 @@ var LlamaWebGpuBridge = class {
|
|
| 6580 |
),
|
| 6581 |
stallPromise
|
| 6582 |
]);
|
| 6583 |
-
if (this._hasMediaParts(options) && !isWarmup && !sawWorkerTokenEvent && String(workerResult || "").trim().length == 0) {
|
| 6584 |
this._emitBridgeWarn(
|
| 6585 |
"llamadart: multimodal worker produced empty response without token events."
|
| 6586 |
);
|
|
@@ -7805,8 +7827,9 @@ function installBridgeWorkerHost() {
|
|
| 7805 |
state
|
| 7806 |
});
|
| 7807 |
};
|
| 7808 |
-
|
| 7809 |
-
|
|
|
|
| 7810 |
const type = message.type;
|
| 7811 |
const id = message.id ?? 0;
|
| 7812 |
try {
|
|
@@ -7826,6 +7849,13 @@ function installBridgeWorkerHost() {
|
|
| 7826 |
}
|
| 7827 |
const method = String(message.method || "");
|
| 7828 |
const args = Array.isArray(message.args) ? message.args : [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7829 |
if (method === "loadModelFromUrl") {
|
| 7830 |
const url = args[0];
|
| 7831 |
const options = args[1] && typeof args[1] === "object" ? { ...args[1] } : {};
|
|
@@ -8097,6 +8127,25 @@ function installBridgeWorkerHost() {
|
|
| 8097 |
postError(id, error);
|
| 8098 |
}
|
| 8099 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8100 |
}
|
| 8101 |
function shouldAutoBootBridgeWorkerHost() {
|
| 8102 |
if (typeof WorkerGlobalScope === "undefined" || !(globalThis instanceof WorkerGlobalScope)) {
|
|
|
|
| 5189 |
_isOperationCallbackCurrent(operation, proxy) {
|
| 5190 |
return this._isOperationCurrent(operation) && proxy === this._workerProxy;
|
| 5191 |
}
|
| 5192 |
+
/**
|
| 5193 |
+
* A bare `cancel()` still resolves with the text the worker generated before
|
| 5194 |
+
* it read the cancel, so the pieces of that text keep streaming until the
|
| 5195 |
+
* call returns. An aborted signal rejects instead, so its stream stops at once.
|
| 5196 |
+
*/
|
| 5197 |
+
_streamsPastBareCancel(operation, proxy) {
|
| 5198 |
+
return operation.state === "cancelling" && !operation.callerSignal?.aborted && proxy === this._workerProxy;
|
| 5199 |
+
}
|
| 5200 |
+
_sendWorkerCancel(proxy, operation = null) {
|
| 5201 |
if (!proxy) {
|
| 5202 |
return;
|
| 5203 |
}
|
|
|
|
| 5212 |
return;
|
| 5213 |
}
|
| 5214 |
try {
|
| 5215 |
+
Promise.resolve(proxy.call(
|
| 5216 |
+
"cancel",
|
| 5217 |
+
[],
|
| 5218 |
+
null,
|
| 5219 |
+
[],
|
| 5220 |
+
operation ? { operationId: operation.id } : null
|
| 5221 |
+
)).catch(() => {
|
| 5222 |
});
|
| 5223 |
} catch (_) {
|
| 5224 |
}
|
|
|
|
| 5239 |
proxies2.add(operation.workerProxy);
|
| 5240 |
}
|
| 5241 |
for (const proxy of proxies2) {
|
| 5242 |
+
this._sendWorkerCancel(proxy, operation);
|
| 5243 |
}
|
| 5244 |
return;
|
| 5245 |
}
|
|
|
|
| 5258 |
proxies.add(operation.workerProxy);
|
| 5259 |
}
|
| 5260 |
for (const proxy of proxies) {
|
| 5261 |
+
this._sendWorkerCancel(proxy, operation);
|
| 5262 |
}
|
| 5263 |
const runtimes = new Set(operation.runtimes || []);
|
| 5264 |
if (operation.runtime) {
|
|
|
|
| 5765 |
return true;
|
| 5766 |
} catch (error) {
|
| 5767 |
this._throwIfDisposed();
|
| 5768 |
+
if (this._isOperationCancellation(error)) {
|
| 5769 |
+
this._workerModelMissing = true;
|
| 5770 |
+
throw createAbortError("Bridge operation was cancelled.");
|
| 5771 |
+
}
|
| 5772 |
this._emitBridgeWarn(
|
| 5773 |
`llamadart: multimodal worker setup failed once; restarting worker (${serializeWorkerError(error)}).`
|
| 5774 |
);
|
|
|
|
| 6245 |
this._recordWorkerGeneration(operation, proxy);
|
| 6246 |
}
|
| 6247 |
const guardedEvent = typeof onEvent === "function" ? (event) => {
|
| 6248 |
+
if (!operation || this._isOperationCallbackCurrent(operation, proxy) || event.event === "usage" && proxy === this._workerProxy || event.event === "token" && this._streamsPastBareCancel(operation, proxy)) {
|
| 6249 |
onEvent(event);
|
| 6250 |
}
|
| 6251 |
} : void 0;
|
| 6252 |
try {
|
| 6253 |
+
const pending = proxy.call(
|
| 6254 |
method,
|
| 6255 |
args,
|
| 6256 |
guardedEvent,
|
| 6257 |
transferList,
|
| 6258 |
operation ? { operationId: operation.id, workerGeneration: operation.workerGeneration } : void 0
|
| 6259 |
);
|
| 6260 |
+
if (operation?.cancelRequested) {
|
| 6261 |
+
this._sendWorkerCancel(proxy, operation);
|
| 6262 |
+
}
|
| 6263 |
+
const response = await pending;
|
| 6264 |
if (response?.state) {
|
| 6265 |
this._acceptWorkerState(operation, proxy, response.state);
|
| 6266 |
}
|
|
|
|
| 6602 |
),
|
| 6603 |
stallPromise
|
| 6604 |
]);
|
| 6605 |
+
if (this._hasMediaParts(options) && !isWarmup && !sawWorkerTokenEvent && !this._activeOperation?.cancelRequested && String(workerResult || "").trim().length == 0) {
|
| 6606 |
this._emitBridgeWarn(
|
| 6607 |
"llamadart: multimodal worker produced empty response without token events."
|
| 6608 |
);
|
|
|
|
| 7827 |
state
|
| 7828 |
});
|
| 7829 |
};
|
| 7830 |
+
const callsInFlight = /* @__PURE__ */ new Map();
|
| 7831 |
+
const isCallInFlight = (operationId) => operationId === void 0 ? callsInFlight.size > 0 : callsInFlight.has(operationId);
|
| 7832 |
+
const handleMessage = async (message) => {
|
| 7833 |
const type = message.type;
|
| 7834 |
const id = message.id ?? 0;
|
| 7835 |
try {
|
|
|
|
| 7849 |
}
|
| 7850 |
const method = String(message.method || "");
|
| 7851 |
const args = Array.isArray(message.args) ? message.args : [];
|
| 7852 |
+
if (method === "cancel") {
|
| 7853 |
+
if (isCallInFlight(message.operationId)) {
|
| 7854 |
+
bridge.cancel();
|
| 7855 |
+
}
|
| 7856 |
+
self.postMessage({ type: "result", id, value: void 0 });
|
| 7857 |
+
return;
|
| 7858 |
+
}
|
| 7859 |
if (method === "loadModelFromUrl") {
|
| 7860 |
const url = args[0];
|
| 7861 |
const options = args[1] && typeof args[1] === "object" ? { ...args[1] } : {};
|
|
|
|
| 8127 |
postError(id, error);
|
| 8128 |
}
|
| 8129 |
};
|
| 8130 |
+
self.onmessage = async (event) => {
|
| 8131 |
+
const message = event.data || {};
|
| 8132 |
+
if (message.type !== "call" || message.method === "cancel") {
|
| 8133 |
+
await handleMessage(message);
|
| 8134 |
+
return;
|
| 8135 |
+
}
|
| 8136 |
+
const operationId = message.operationId;
|
| 8137 |
+
callsInFlight.set(operationId, (callsInFlight.get(operationId) ?? 0) + 1);
|
| 8138 |
+
try {
|
| 8139 |
+
await handleMessage(message);
|
| 8140 |
+
} finally {
|
| 8141 |
+
const remaining = (callsInFlight.get(operationId) ?? 1) - 1;
|
| 8142 |
+
if (remaining > 0) {
|
| 8143 |
+
callsInFlight.set(operationId, remaining);
|
| 8144 |
+
} else {
|
| 8145 |
+
callsInFlight.delete(operationId);
|
| 8146 |
+
}
|
| 8147 |
+
}
|
| 8148 |
+
};
|
| 8149 |
}
|
| 8150 |
function shouldAutoBootBridgeWorkerHost() {
|
| 8151 |
if (typeof WorkerGlobalScope === "undefined" || !(globalThis instanceof WorkerGlobalScope)) {
|
webgpu_bridge/manifest.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
"size_bytes": 19006
|
| 6 |
},
|
| 7 |
"llama_webgpu_bridge.js": {
|
| 8 |
-
"sha256": "
|
| 9 |
-
"size_bytes":
|
| 10 |
},
|
| 11 |
"llama_webgpu_bridge_worker.js": {
|
| 12 |
"sha256": "47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca",
|
|
@@ -30,8 +30,8 @@
|
|
| 30 |
}
|
| 31 |
},
|
| 32 |
"assets_repository": "leehack/llama-web-bridge-assets",
|
| 33 |
-
"bridge_assets_tag": "v0.1.
|
| 34 |
-
"bridge_commit": "
|
| 35 |
"bridge_repository": "leehack/llama-web-bridge",
|
| 36 |
"capabilities": {
|
| 37 |
"memory64": true,
|
|
@@ -66,8 +66,8 @@
|
|
| 66 |
"size_bytes": 19006
|
| 67 |
},
|
| 68 |
"llama_webgpu_bridge.js": {
|
| 69 |
-
"sha256": "
|
| 70 |
-
"size_bytes":
|
| 71 |
},
|
| 72 |
"llama_webgpu_bridge_worker.js": {
|
| 73 |
"sha256": "47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca",
|
|
@@ -90,15 +90,15 @@
|
|
| 90 |
"size_bytes": 10479436
|
| 91 |
}
|
| 92 |
},
|
| 93 |
-
"github_run_id": "
|
| 94 |
-
"github_run_url": "https://github.com/leehack/llama-web-bridge/actions/runs/
|
| 95 |
"llama_cpp_commit": "620d2225cc436ab0b001e3200e590e3b286ef9ab",
|
| 96 |
"llama_cpp_tag": "v0.7.0",
|
| 97 |
"native_commit": "298314bd0ff4650363e0e63b81399d5618869a63",
|
| 98 |
"native_manifest_sha256": "92b9f1ea6d3ec3dd826122ffde3cf21b2b22036c368e826d86e927284c6908f4",
|
| 99 |
"native_release_tag": "v0.7.0-2",
|
| 100 |
"native_repository": "leehack/llamadart-native",
|
| 101 |
-
"orchestrator_correlation_id": "auto-stable-v0.7.0-2-92b9f1ea6d3ec3dd-build-
|
| 102 |
"qualification_gates": {
|
| 103 |
"multimodal": "passed",
|
| 104 |
"speech_to_text": "required-automated-qualification",
|
|
@@ -107,9 +107,9 @@
|
|
| 107 |
},
|
| 108 |
"release_channel": "stable",
|
| 109 |
"release_rebuild": 0,
|
| 110 |
-
"release_tag": "v0.1.
|
| 111 |
"schema_version": 2,
|
| 112 |
-
"source_commit": "
|
| 113 |
"source_repository": "leehack/llama-web-bridge",
|
| 114 |
"unproven_capabilities": {
|
| 115 |
"hardware_gpu_acceleration": "unavailable-on-hosted-runners",
|
|
|
|
| 5 |
"size_bytes": 19006
|
| 6 |
},
|
| 7 |
"llama_webgpu_bridge.js": {
|
| 8 |
+
"sha256": "984e42a2e3d470ac74d922effc0402ba6e4d940027f2b8b088213b0ce0aaa10c",
|
| 9 |
+
"size_bytes": 299873
|
| 10 |
},
|
| 11 |
"llama_webgpu_bridge_worker.js": {
|
| 12 |
"sha256": "47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca",
|
|
|
|
| 30 |
}
|
| 31 |
},
|
| 32 |
"assets_repository": "leehack/llama-web-bridge-assets",
|
| 33 |
+
"bridge_assets_tag": "v0.1.71",
|
| 34 |
+
"bridge_commit": "24b1b5f14ea6c20e001b18af42c4568b7dbba025",
|
| 35 |
"bridge_repository": "leehack/llama-web-bridge",
|
| 36 |
"capabilities": {
|
| 37 |
"memory64": true,
|
|
|
|
| 66 |
"size_bytes": 19006
|
| 67 |
},
|
| 68 |
"llama_webgpu_bridge.js": {
|
| 69 |
+
"sha256": "984e42a2e3d470ac74d922effc0402ba6e4d940027f2b8b088213b0ce0aaa10c",
|
| 70 |
+
"size_bytes": 299873
|
| 71 |
},
|
| 72 |
"llama_webgpu_bridge_worker.js": {
|
| 73 |
"sha256": "47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca",
|
|
|
|
| 90 |
"size_bytes": 10479436
|
| 91 |
}
|
| 92 |
},
|
| 93 |
+
"github_run_id": "39963902003",
|
| 94 |
+
"github_run_url": "https://github.com/leehack/llama-web-bridge/actions/runs/39963902003",
|
| 95 |
"llama_cpp_commit": "620d2225cc436ab0b001e3200e590e3b286ef9ab",
|
| 96 |
"llama_cpp_tag": "v0.7.0",
|
| 97 |
"native_commit": "298314bd0ff4650363e0e63b81399d5618869a63",
|
| 98 |
"native_manifest_sha256": "92b9f1ea6d3ec3dd826122ffde3cf21b2b22036c368e826d86e927284c6908f4",
|
| 99 |
"native_release_tag": "v0.7.0-2",
|
| 100 |
"native_repository": "leehack/llamadart-native",
|
| 101 |
+
"orchestrator_correlation_id": "auto-stable-v0.7.0-2-92b9f1ea6d3ec3dd-build-24b1b5f14ea6c20e",
|
| 102 |
"qualification_gates": {
|
| 103 |
"multimodal": "passed",
|
| 104 |
"speech_to_text": "required-automated-qualification",
|
|
|
|
| 107 |
},
|
| 108 |
"release_channel": "stable",
|
| 109 |
"release_rebuild": 0,
|
| 110 |
+
"release_tag": "v0.1.71",
|
| 111 |
"schema_version": 2,
|
| 112 |
+
"source_commit": "24b1b5f14ea6c20e001b18af42c4568b7dbba025",
|
| 113 |
"source_repository": "leehack/llama-web-bridge",
|
| 114 |
"unproven_capabilities": {
|
| 115 |
"hardware_gpu_acceleration": "unavailable-on-hosted-runners",
|
webgpu_bridge/sha256sums.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
05d04252ae79a75ce43ce912d92334c6438b84de83eaeafe2ef9a6d4a88ce036 llama_webgpu_core.js
|
| 3 |
c760eadf57fe0d5bf3446d4102c2c5aad1612de7f055ea2bf491344a2b2db0e7 llama_webgpu_core.wasm
|
| 4 |
47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca llama_webgpu_bridge_worker.js
|
|
|
|
| 1 |
+
984e42a2e3d470ac74d922effc0402ba6e4d940027f2b8b088213b0ce0aaa10c llama_webgpu_bridge.js
|
| 2 |
05d04252ae79a75ce43ce912d92334c6438b84de83eaeafe2ef9a6d4a88ce036 llama_webgpu_core.js
|
| 3 |
c760eadf57fe0d5bf3446d4102c2c5aad1612de7f055ea2bf491344a2b2db0e7 llama_webgpu_core.wasm
|
| 4 |
47bbfa0fe897e708455b9497e9aa41d2e94489c329300c33b12936fb3169deca llama_webgpu_bridge_worker.js
|