tzmtwtr commited on
Commit
94068b8
1 Parent(s): af57887
Files changed (1) hide show
  1. index.js +4 -0
index.js CHANGED
@@ -1,5 +1,9 @@
 
 
1
  import { env, pipeline } from "@xenova/transformers";
2
 
 
 
3
  env.localModelPath = __dirname + '/model'
4
 
5
  let pipe = null;
 
1
+ import path from 'path';
2
+ import { fileURLToPath } from 'url';
3
  import { env, pipeline } from "@xenova/transformers";
4
 
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
  env.localModelPath = __dirname + '/model'
8
 
9
  let pipe = null;