Hugging Face Tutorial - ! TypeError: Failed to fetch

Hi lovely people!

I am following the Transforming Images with HuggingFace.js Inference lesson. My hugging face API key was working correctly - but now everytime I run my scim I get the ! TypeError: Failed to fetch message.

I have generated a new key (x2) and updated my environment variable but haven’t had any luck resolving the issue. I have also ensured that all of the access permissions are granted and the token is ‘finegrained’.

Is this a wider issue - or have I set up something incorrectly?

In the screenshot provided I have not changed any of the code - just tried to run the scrim.

Much appreciated! Cam.

Hi, I experiencing the same issue recently, and I think it depends on the CORS on the HF side. This is the error I get from the browser’s console:

Access to fetch at 'https://api-inference.huggingface.co/models/parler-tts/parler-tts-large-v1' from origin 'https://cw0.scrimba.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Thanks very much! I also had the same CORS error in my console. So I just completed the lesson with a different image-to-image model. Thanks for taking the time to reply to my thread! Much appreciated.