Skip to content

Commit

Permalink
fix: use explicit URL when loading MediaPipe wasm resources in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aannirajpatel committed Dec 22, 2023
1 parent 7dd3fb1 commit 4f180e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MediaPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FilesetResolver, TextEmbedder } from '@mediapipe/tasks-text';
let textEmbedder: TextEmbedder;

export async function createEmbedder() {
const textFiles = await FilesetResolver.forTextTasks(process.env.PUBLIC_URL + "/wasm/");
const textFiles = await FilesetResolver.forTextTasks(process.env.NODE_ENV === 'production' ? 'https://aanpatel.tech/mediapipe-text-workshop/wasm/' : process.env.PUBLIC_URL + "/wasm/");
textEmbedder = await TextEmbedder.createFromOptions(
textFiles,
{
Expand Down

0 comments on commit 4f180e6

Please sign in to comment.