# \`gr.Interface.load(hugging\_model\_repo)\` -\> AssertionError: Invalid model name or src

**URL:** <https://discuss.huggingface.co/t/gr-interface-load-hugging-model-repo-assertionerror-invalid-model-name-or-src/26471>\
**Category:** 🔒 Gradio\
**Created:** [November 21, 2022, 8:48pm UTC](https://discuss.huggingface.co/t/gr-interface-load-hugging-model-repo-assertionerror-invalid-model-name-or-src/26471 "2022-11-21T20:48:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkzar90](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alkzar90/32/30144_2.png) [@alkzar90](https://discuss.huggingface.co/u/alkzar90)\
**Post date:** [November 21, 2022, 8:48pm UTC](https://discuss.huggingface.co/t/gr-interface-load-hugging-model-repo-assertionerror-invalid-model-name-or-src/26471/1 "2022-11-21T20:48:53Z")

</div>

Hi,

I’m trying to use the `gr.Interface.load()` to create a quick demo from a [ViT fine-tuned model repo](https://huggingface.co/alkzar90/skynet), but there is an error during the building ([here](https://huggingface.co/spaces/alkzar90/rock-glacier-detector) is the demo repo, also error below). I made another [demo](https://huggingface.co/spaces/alkzar90/croupier-creature-app/blob/main/app.py) following the same process before (ViT + fine-tuning → model repo → gradio), and it works. Any help finding hints about the assertion error is welcome 😊; the model is correctly fetching: `Fetching model from: https://huggingface.co/alkzar90/skynet` (and the repo URL is ok).

```python
Fetching model from: https://huggingface.co/alkzar90/skynet
Traceback (most recent call last):
  File "app.py", line 5, in <module>
    iface = gr.Interface.load(name='alkzar90/skynet', src='models')
  File "/home/user/.local/lib/python3.8/site-packages/gradio/interface.py", line 108, in load
    return super().load(name=name, src=src, api_key=api_key, alias=alias, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py", line 1123, in load
    return external.load_blocks_from_repo(name, src, api_key, alias, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/external.py", line 57, in load_blocks_from_repo
    blocks: gradio.Blocks = factory_methods[src](name, api_key, alias, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/external.py", line 70, in from_model
    assert response.status_code == 200, "Invalid model name or src"
AssertionError: Invalid model name or src

```

The dataset is the only difference between model repos, but both models were trained using the transformer pipeline.

best,

---

<div class="post-metadata">

**Author:** ![freddyaboulton](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/freddyaboulton/32/32732_2.png) [@freddyaboulton](https://discuss.huggingface.co/u/freddyaboulton)\
**Post date:** [November 21, 2022, 9:21pm UTC](https://discuss.huggingface.co/t/gr-interface-load-hugging-model-repo-assertionerror-invalid-model-name-or-src/26471/2 "2022-11-21T21:21:46Z")

</div>

Hi @alkzar90 !

Might be because you have to accept the license prior to using the model with the inference api?

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/8/8f5540a6bca6dc663d140525891737f0e79de31d.png)

I wonder if passing in your huggingface token to `gr.Interface.load` will fix it.

---

<div class="post-metadata">

**Author:** ![alkzar90](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alkzar90/32/30144_2.png) [@alkzar90](https://discuss.huggingface.co/u/alkzar90)\
**Post date:** [November 21, 2022, 9:34pm UTC](https://discuss.huggingface.co/t/gr-interface-load-hugging-model-repo-assertionerror-invalid-model-name-or-src/26471/3 "2022-11-21T21:34:11Z")

</div>

Hey @freddyaboulton, it works, thanks!  
Adding that suggestion to the error message could be helpful 😮

`gr.Interface.load(..., api_key='read_token')`
