Local downloaded models uploading
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 SentenceTransformermodel_path = r"path of downloaded model"model = SentenceTransformer(model_path) it is giving repo id error.
2024-11-06T10:57:54Z
Is this a bug?github.com/UKPLab/sentence-transformers2.3.0 issues loading model from local diropened03:27PM - 30 Jan 24 UTCclosed05:09PM - 30 Jan 24 UTCwjdunlopEncountering 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.```