How do I access my models I saved inside a folder?
I have fine tuned a model and saved it on my hugging-face inside a particular folder since I will save multiple folders having trained models for my use-case. I am able to access the path & print its contents using:fs = HfFileSystem(token=REDACTED_TOKEN)
file_find = fs.ls(folder_path, detail=True)But how do I access the files for:model, tokenizer = FastLanguageModel.from_pretrained(model_name=model_name,…)Although I have used repo_type=space (also tried saving & using from Model), my error:HFValidationError( huggingface_hub.errors.HFValidationError: Repo id must be in the form ‘repo_name’ or ‘namespace/repo_name’: ‘//<folder_path>’. Use repo_type argument if needed.Some variations I tried I got:Error loading model: <folder_path>/*.json (invalid repository id)
2024-11-12T12:36:22Z
The functions related to HF models are designed on the premise that there is one model per repo, so they may not work properly.In the case of Diffusers, you may be able to use the subfolder option to get around this.github.com/huggingface/diffusersLoading from_pretrained from subfolder with a path to directory raises ValueError: is not a folder containing a `.index.json` file or a pytorch_model.bin or a model.safetensors fileopened08:47PM - 18 Jul 24 UTCclosed03:55AM - 19 Jul 24 UTCchristopher5106bug### Describe the bug

Loading pretrained pipeline component such as UNET from…subfolder with path does not work.

Most of your examples use the subfolder formulation, for example [here](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py#L616) or [here](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py#L693) and it is supposed to work with a path.

### Reproduction

Save "stabilityai/stable-diffusion-xl-base-1.0" locally on the computer in a "pretrained" folder for example and run 

```python
unet = UNet2DConditionModel.from_pretrained(
    "pretrained", subfolder="unet",
)
```

raises an error `ValueError: pretrained is not a folder containing a `.index.json` file or a pytorch_model.bin or a model.safetensors file`

while it works with the remote formulation `model repo + model id` for hosted models.

A work around is to use 
```python
unet = UNet2DConditionModel.from_pretrained(
    "pretrained/unet",
)
```

that works. If this is the only way to load component weights from directory path, that means all examples can't be run from local path and variable `args.pretrained_model_name_or_path` should be named `args.pretrained_model_name` only.


### Logs

_No response_

### System Info

Python==3.10.14
Conda env without accelerate
torch==2.3.1
Diffusers installed from source at commit a785992c1d6fcb1ff66f8a0d68d09a0a81b909e8 


### Who can help?

@DN6 @yiyixuxu @sayakpaul