# Local downloaded models uploading

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flocal-downloaded-models-uploading%2F115983%3E%5C
**Category:** Beginners\
**Created:** [November 6, 2024, 10:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flocal-downloaded-models-uploading%2F115983 "2024-11-06T10:49:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajivsalwan1969](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@rajivsalwan1969](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frajivsalwan1969)%5C
**Post date:** [November 6, 2024, 10:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flocal-downloaded-models-uploading%2F115983%2F1 "2024-11-06T10:49:28Z")

</div>

I have downloaded all-mpnet-base-v2 model on my server. i am not able to upload it in python using path. my statements are from sentence\_transformers import SentenceTransformer

model\_path = r"path of downloaded model"  
model = SentenceTransformer(model\_path) it is giving repo id error.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [November 6, 2024, 10:57am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Flocal-downloaded-models-uploading%2F115983%2F2 "2024-11-06T10:57:54Z")

</div>

Is this a bug?

> <https://github.com/UKPLab/sentence-transformers/issues/2459>
>
> Encountering a problem that may be of similar origin with #2458, opening another… issue as it may not be same exact source. Our issue was with loading some old models by model path where we have moved a .tar.gz of the file. 
> 
> In my case, the failure got to \`huggingface\_hub.utils.\_validators.HFValidationError: Repo id must be in the form 'repo\_name' or 'namespace/repo\_name': '/opt/ml/model'. Use \`repo\_type\` argument if needed.\` We were loading the model in question into \`/opt/ml/model\` and loading it by dir name was not a problem prior to 2.3.0 
> 
> Not sure if this is an issue with sentence-transformers or with some intermediate point between sentence-transformers and huggingface/transformers updates, both of which were using newer versions on this failing buidl
> 
> Ultimately, reverting back to 2.2.2 fixed the issue. 
> 
> \`\`\`Traceback (most recent call last):
> File "/opt/conda/lib/python3.10/site-packages/sagemaker\_huggingface\_inference\_toolkit/handler\_service.py", line 243, in handle
> self.initialize(context)
> File "/opt/conda/lib/python3.10/site-packages/sagemaker\_huggingface\_inference\_toolkit/handler\_service.py", line 83, in initialize
> self.model = self.load(\*(\[self.model\_dir\] + self.load\_extra\_arg))
> File "/opt/ml/model/code/inference.py", line 60, in model\_fn
> return model(model\_dir)
> File "/opt/ml/model/code/inference.py", line 67, in model
> model = SentenceTransformer(model\_dir, device='cuda')
> File "/opt/conda/lib/python3.10/site-packages/sentence\_transformers/SentenceTransformer.py", line 194, in \_\_init\_\_
> modules = self.\_load\_sbert\_model(
> File "/opt/conda/lib/python3.10/site-packages/sentence\_transformers/SentenceTransformer.py", line 1062, in \_load\_sbert\_model
> module\_path = load\_dir\_path(
> File "/opt/conda/lib/python3.10/site-packages/sentence\_transformers/util.py", line 537, in load\_dir\_path
> repo\_path = snapshot\_download(\*\*download\_kwargs)
> File "/opt/conda/lib/python3.10/site-packages/huggingface\_hub/utils/\_validators.py", line 110, in \_inner\_fn
> validate\_repo\_id(arg\_value)
> File "/opt/conda/lib/python3.10/site-packages/huggingface\_hub/utils/\_validators.py", line 158, in validate\_repo\_id
> raise HFValidationError(
> huggingface\_hub.utils.\_validators.HFValidationError: Repo id must be in the form 'repo\_name' or 'namespace/repo\_name': '/opt/ml/model'. Use \`repo\_type\` argument if needed.\`\`\`
