mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-13 08:51:28 +00:00
set navigator and pipeline to any to bypass build issue. Its issue is originating from node modules, not my code so its fine :-), I hope
This commit is contained in:
parent
5e48f0a566
commit
06fe177f59
1 changed files with 8 additions and 4 deletions
|
|
@ -39,10 +39,12 @@ export class WebGPUNotAvailableError extends Error {
|
|||
*/
|
||||
export const checkWebGPUAvailability = async (): Promise<boolean> => {
|
||||
try {
|
||||
if (!navigator.gpu) {
|
||||
// Cast to any to avoid WebGPU types not being available in all TS configs
|
||||
const nav = navigator as any;
|
||||
if (!nav.gpu) {
|
||||
return false;
|
||||
}
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
const adapter = await nav.gpu.requestAdapter();
|
||||
if (!adapter) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -133,7 +135,8 @@ export const initEmbedder = async (
|
|||
console.log('🔧 Initializing WebGPU backend...');
|
||||
}
|
||||
|
||||
embedderInstance = await pipeline(
|
||||
// Type assertion needed due to complex union types in transformers.js
|
||||
embedderInstance = await (pipeline as any)(
|
||||
'feature-extraction',
|
||||
finalConfig.modelId,
|
||||
{
|
||||
|
|
@ -162,7 +165,8 @@ export const initEmbedder = async (
|
|||
console.log('🔧 Initializing WASM backend (this will be slower)...');
|
||||
}
|
||||
|
||||
embedderInstance = await pipeline(
|
||||
// Type assertion needed due to complex union types in transformers.js
|
||||
embedderInstance = await (pipeline as any)(
|
||||
'feature-extraction',
|
||||
finalConfig.modelId,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue