# Error Loading Custom Transformers.js model from hugging face hub

**URL:** <https://discuss.huggingface.co/t/error-loading-custom-transformers-js-model-from-hugging-face-hub/80584>\
**Category:** 🤗Transformers\
**Created:** [April 7, 2024, 5:45pm UTC](https://discuss.huggingface.co/t/error-loading-custom-transformers-js-model-from-hugging-face-hub/80584 "2024-04-07T17:45:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakerytclarke](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zakerytclarke/32/1290_2.png) [@zakerytclarke](https://discuss.huggingface.co/u/zakerytclarke)\
**Post date:** [April 7, 2024, 5:45pm UTC](https://discuss.huggingface.co/t/error-loading-custom-transformers-js-model-from-hugging-face-hub/80584/1 "2024-04-07T17:45:29Z")

</div>

I have trained a custom model and compiled to ONNX for transformers.js as outlined here: [Use custom models](https://huggingface.co/docs/transformers.js/en/custom_usage)

The model is located here: [teapotai/instruct-teapot · Hugging Face](https://huggingface.co/teapotai/instruct-teapot)

I am running this node code:

```javascript
import { pipeline, env } from '@xenova/transformers';
env.allowLocalModels = false;
env.backends.onnx.wasm.numThreads = 1;
const generative_model = await pipeline('text2text-generation', 'teapotai/instruct-teapot');

```

This works when running locally, but when deployed, the model is unable to load.

I have found the following error:

```auto
Uncaught (in promise) Error: Could not locate file: "{hugging_face_url}/teapotai/instruct-teapot/resolve/main/onnx/decoder_model_merged_quantized.onnx"

```

I’ve noticed that  
{hugging\_face\_url}/teapotai/instruct-teapot/ **blob** /main/onnx/decoder\_model\_merged\_quantized.onnx  
exists but the requested  
{hugging\_face\_url}/teapotai/instruct-teapot/ **resolve** /main/onnx/decoder\_model\_merged\_quantized.onnx  
does not exist.

However for the example models in the docs, the resolve/ does seem to exist:  
{hugging\_face\_url}/Xenova/LaMini-Flan-T5-783M/resolve/main/onnx/decoder\_model\_merged\_quantized.onnx

Is there a setting or configuration on huggingface required to serve this repo? Thanks!

(Apologies for the {hugging\_face\_url}, the forum would only let me link 2 urls)

---

<div class="post-metadata">

**Author:** ![lancejpollard](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lancejpollard/32/29479_2.png) [@lancejpollard](https://discuss.huggingface.co/u/lancejpollard)\
**Post date:** [July 27, 2024, 10:20am UTC](https://discuss.huggingface.co/t/error-loading-custom-transformers-js-model-from-hugging-face-hub/80584/2 "2024-07-27T10:20:16Z")

</div>

I think you need to set the `HF_TOKEN` env variable with a huggingface access token.
