Gate local Gemma behind explicit terms acceptance
Build and publish frontend / publish (push) Successful in 45s
Build and publish frontend / publish (push) Successful in 45s
This commit is contained in:
@@ -18,6 +18,8 @@ self.fetch = async (resource, options) => {
|
||||
const requestedUrl = resource instanceof Request ? resource.url : String(resource);
|
||||
const localModelUrl = localPiperModelUrl(requestedUrl, self.location.origin);
|
||||
if (!localModelUrl) {
|
||||
const requestUrl = new URL(requestedUrl, self.location.origin);
|
||||
if (requestUrl.origin !== self.location.origin) throw new Error(`External Piper asset blocked: ${requestUrl.origin}`);
|
||||
const runtimeAsset = requestedUrl.includes('/static/piper-wasm-v1/onnx/');
|
||||
const runtimeFile = runtimeAsset ? new URL(requestedUrl, self.location.origin).pathname.split('/').pop() : undefined;
|
||||
if (activeRequestId && runtimeAsset) {
|
||||
|
||||
Reference in New Issue
Block a user