# How can I load models from any remote url

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%3E%5C
**Category:** Beginners\
**Created:** [August 24, 2021, 3:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452 "2021-08-24T15:54:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![karkawal](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@karkawal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkarkawal)%5C
**Post date:** [August 24, 2021, 3:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%2F1 "2021-08-24T15:54:57Z")

</div>

Hi,

I want to set up a http file server (simples case would be http localhost) that will contain my models or simply fork a github repository with pretrained models. I see that when loading a pretrained model a `transformers` or `sentence-transformers` libraries try to get files from [huggingface.co](http://huggingface.co) by default. Is there a way to change it and load e.g. from [http://localhost:8000](http://localhost:8000) without modifying the insides of the library? E.g. i tried to simply put the url in `pt_model = AutoModelForSequenceClassification.from_pretrained('http://localhost:8000')`, but it failed to work. I also tried to use `mirror` parameter with adding my address to `PRESET_MIRROR_DICT` in configuration\_utils.py, but that is already modification that I want to avoid. It didn’t work besides.

Is there any proper way to do so?

---

<div class="post-metadata">

**Author:** ![zirui3](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zirui3/32/32893_2.png) [@zirui3](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzirui3)%5C
**Post date:** [August 25, 2021, 1:28am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%2F2 "2021-08-25T01:28:31Z")

</div>

you can try to paas your `http server` as param like this:

```auto
proxies = {"http": "http://localhost:8000"}
mode = AutoModelForSequenceClassification.from_pretrained(proxies)

```

---

<div class="post-metadata">

**Author:** ![karkawal](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@karkawal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkarkawal)%5C
**Post date:** [August 25, 2021, 6:34am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%2F3 "2021-08-25T06:34:23Z")

</div>

This seems to work just fine, thank you!

---

<div class="post-metadata">

**Author:** ![karkawal](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@karkawal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkarkawal)%5C
**Post date:** [August 26, 2021, 11:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%2F4 "2021-08-26T11:56:15Z")

</div>

Well, not really. Sorry for the false alert, but this doesn’t work. It worked for a while, since the path on the server was the same as the path to model locally, so it just read it from my disk.

---

<div class="post-metadata">

**Author:** ![zirui3](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zirui3/32/32893_2.png) [@zirui3](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzirui3)%5C
**Post date:** [August 27, 2021, 2:55am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-load-models-from-any-remote-url%2F9452%2F5 "2021-08-27T02:55:55Z")

</div>

sorry, i misunderstood your question, the transformers library currently dose not seem to support private host, you can look this [issue](https://github.com/huggingface/transformers/issues/10654) for reference, and there is a  
workround you can try
