🐛 fixes for transformers.js compatibility
This commit is contained in:
parent
31226a31cc
commit
2cac5c8fc1
4 changed files with 6 additions and 7 deletions
|
|
@ -2,7 +2,7 @@ import {
|
|||
PipelineType,
|
||||
env,
|
||||
pipeline,
|
||||
} from "../../vendor/modules/@xenova/transformers";
|
||||
} from "../../vendor/modules/@xenova/transformers/src/transformers";
|
||||
|
||||
import path from "path";
|
||||
import BaseEmbeddingsProvider from "./BaseEmbeddingsProvider";
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@
|
|||
"noEmitOnError": false,
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["./**/*.ts", "./**/*.js"],
|
||||
"include": ["./**/*.ts", "./**/*.js", "./**/*.d.ts"],
|
||||
"exclude": ["test", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@
|
|||
"declaration": true,
|
||||
"declarationMap": true
|
||||
},
|
||||
"include": ["./**/*.ts", "**/*.js"],
|
||||
"include": ["./**/*.ts", "**/*.js", "./**/*.d.ts"],
|
||||
"exclude": ["test", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import url from 'url';
|
||||
|
||||
import { ONNX } from './backends/onnx.js';
|
||||
const { env: onnx_env } = ONNX;
|
||||
|
|
@ -38,9 +37,9 @@ const PATH_AVAILABLE = !isEmpty(path); // check if path is available
|
|||
|
||||
const RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;
|
||||
|
||||
const __dirname = RUNNING_LOCALLY
|
||||
? path.dirname(path.dirname(url.fileURLToPath(import.meta.url)))
|
||||
: './';
|
||||
// const __dirname = RUNNING_LOCALLY
|
||||
// ? path.dirname(path.dirname(url.fileURLToPath(import.meta.url)))
|
||||
// : './';
|
||||
|
||||
// Only used for environments with access to file system
|
||||
const DEFAULT_CACHE_DIR = RUNNING_LOCALLY
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue