quickgrid commited on
Commit
e611b8d
·
verified ·
1 Parent(s): c2e2021

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +11 -0
index.html CHANGED
@@ -378,6 +378,17 @@ async function getTransformers() {
378
  T = await import('https://cdn.jsdelivr.net/npm/@xenova/transformers@latest');
379
  }
380
  T.env.allowLocalModels = false;
 
 
 
 
 
 
 
 
 
 
 
381
  return T;
382
  }
383
 
 
378
  T = await import('https://cdn.jsdelivr.net/npm/@xenova/transformers@latest');
379
  }
380
  T.env.allowLocalModels = false;
381
+ T.env.backends.onnx.wasm.proxy = false;
382
+
383
+ // FORCE DISCRETE GPU (NVIDIA) OVER INTEGRATED GPU (AMD)
384
+ if (navigator.gpu) {
385
+ const _origRequestAdapter = navigator.gpu.requestAdapter.bind(navigator.gpu);
386
+ navigator.gpu.requestAdapter = function(opts = {}) {
387
+ console.log('[GPU] Requesting adapter with powerPreference: high-performance');
388
+ return _origRequestAdapter({ ...opts, powerPreference: 'high-performance' });
389
+ };
390
+ }
391
+
392
  return T;
393
  }
394