Skip to content

Commit

Permalink
Fix missing var
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Mar 27, 2024
1 parent 333c547 commit 0a29022
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const PATH_AVAILABLE = !isEmpty(path); // check if path is available

const RUNNING_LOCALLY = FS_AVAILABLE && PATH_AVAILABLE;


let localPath = './';
if (IS_REACT_NATIVE) {
localPath = fs.DocumentDirectoryPath;
Expand All @@ -64,7 +65,7 @@ if (!IS_REACT_NATIVE && onnx_env?.wasm) {
// We use remote wasm files by default to make it easier for newer users.
// In practice, users should probably self-host the necessary .wasm files.
onnx_env.wasm.wasmPaths = RUNNING_LOCALLY
? path.join(__dirname, '/dist/')
? path.join(localPath, '/dist/')
: `https://cdn.jsdelivr.net/npm/@xenova/transformers@${VERSION}/dist/`;
}

Expand Down

0 comments on commit 0a29022

Please sign in to comment.