jamezmca / free-scribe

React web based transcription & translation app that uses web workers to run ML models in the browser
27 stars 13 forks source link

Error with translate.worker.js or Xenova/nllb-200-distilled-600M #4

Open Hemanth12-git opened 2 months ago

Hemanth12-git commented 2 months ago

Whenever i try to run the translation part, the following error comes up on the console Error loading pipeline: SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON at JSON.parse (<anonymous>) at getModelJSON (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=ce3fabd1:14328:15) at async Promise.all (index 0) at async loadTokenizer (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=ce3fabd1:17831:16) at async AutoTokenizer.from_pretrained (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=ce3fabd1:21018:46) at async Promise.all (index 0) at async loadItems (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=ce3fabd1:29508:3) at async pipeline (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=ce3fabd1:29469:19) at async MyTranslationPipeline.getInstance (http://localhost:5173/src/utils/translate.worker.js?worker_file&type=module:12:33) at async http://localhost:5173/src/utils/translate.worker.js?worker_file&type=module:24:26

Its basically saying that following error is due to error loading pipeline and it is not a valid JSON.

I tried running it in public and private websites and its the same result.

Looked up for documentation on the xenova transformers but couldnt come up with a solution.

Please look up to this asap and publish a solution for this

AayushThakur1999 commented 2 months ago

Hey someone in the issues has shared a solution to this problem. It's not the optimal solution but it's working for me:

import { pipeline, env } from '@xenova/transformers';
env.allowLocalModels = false;
env.useBrowserCache = false;
EthanCh30 commented 2 months ago

Hey someone in the issues has shared a solution to this problem. It's not the optimal solution but it's working for me:

import { pipeline, env } from '@xenova/transformers';
env.allowLocalModels = false;
env.useBrowserCache = false;

I use your method, it work, but it generate a new problem, as you say in the new issue: Translation's LOADING is not stop

Hemanth12-git commented 2 months ago

Yeah the translation part is loading forever. Anyways it was a nice project 😄