Loading Phi 1.5 model from the hub gives warning that model is uninitialized 
Author: gabeorlanski
Pull request: no

### System Info

- `transformers` version: 4.36.2
- Platform: Linux-5.15.0-91-generic-x86_64-with-glibc2.35
- Python version: 3.10.13
- Huggingface_hub version: 0.20.1
- Safetensors version: 0.4.1
- Accelerate version: 0.25.0
- Accelerate config:    - compute_environment: LOCAL_MACHINE
        - distributed_type: DEEPSPEED
        - mixed_precision: bf16
        - use_cpu: False
        - debug: False
        - num_processes: 1
        - machine_rank: 0
        - num_machines: 1
        - rdzv_backend: static
        - same_network: True
        - main_training_function: main
        - deepspeed_config: {'gradient_accumulation_steps': 1, 'gradient_clipping': 1.0, 'offload_optimizer_device': 'cpu', 'offload_param_device': 'none', 'zero3_init_flag': False, 'zero_stage': 2}
        - downcast_bf16: no
        - tpu_use_cluster: False
        - tpu_use_sudo: False
        - tpu_env: []
- PyTorch version (GPU?): 2.1.2+cu121 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

### Who can help?

@ArthurZucker @younesbelkada 

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Run the following code:
```Python
from transformers import PhiForCausalLM
model = PhiForCausalLM.from_pretrained("microsoft/phi-1.5")
```
This happens for all phi models and has only started happening recently. It worked fine a few days ago. I have tried this both in my conda environment, a fresh one, and using the official huggingface docker image. It happened in all three.

Additionally if i run:
```Python
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", trust_remote_code =True)
```
The same error occurs.

If I run:
```Python
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", use_safetensors= True, trust_remote_code =True)
```
The model hangs and never loads.

### Expected behavior

The model should load with the initialized weights from the hub.

Comments:
From the [model card](https://huggingface.co/microsoft/phi-2):
> If you are using transformers>=4.36.0, always load the model with trust_remote_code=True to prevent side-effects.

You'll find a few examples on how to load the model there. The following should work:
```python
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", trust_remote_code=True)
```

I tried that and also tried deleting the downloaded file then running the code, issue still persists only with Phi1.5. 

Hey, that is expected, `model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", use_safetensors= True, trust_remote_code =True)` will allow you to do that, but if you want to use the converted checkpoints you should use the ones share by @susnato here hf.co/susnato/phi-2 

will be fixed by #28392 

So with Phi-2 that does work. But with Phi 1.5 the model hangs and never loads. I tried deleting the downloaded model from before, and it only downloads the config this time but, again, does not load.

I updated the issue accordingly to specify this is only happening with Phi 1.5.

What checkpoint are you using for phi 1.5? @gabeorlanski 

I am using [microsoft/phi-1_5](https://huggingface.co/microsoft/phi-1_5)

To update, it _does_ end up finishing, but gave me this error:
```shell
Traceback (most recent call last):
  File "/u/g/o/gorlanski/miniconda3/envs/syncode/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 286, in hf_raise_for_status
    response.raise_for_status()
  File "/u/g/o/gorlanski/miniconda3/envs/syncode/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://huggingface.co/api/models/microsoft/phi-1_5/discussions?page_index=11923
```

I set logging to debug level, and it appears to be going through all of the discussion pages:
```shell
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] Starting new HTTPS connection (2): huggingface.co:443
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "HEAD /microsoft/phi-1_5/resolve/main/config.json HTTP/1.1" 200 0
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5 HTTP/1.1" 200 3080
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5/commits/main HTTP/1.1" 200 16853
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5/commits/main?p=1 HTTP/1.1" 200 1602
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5/discussions?page_index=0 HTTP/1.1" 200 20155
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5/discussions?page_index=1 HTTP/1.1" 200 20155
[2024-01-10 10:00:25][urllib3.connectionpool][DEBUG] https://huggingface.co:443 "GET /api/models/microsoft/phi-1_5/discussions?page_index=2 HTTP/1.1" 200 20155
```



Can you please try to load from - `susnato/phi-1_5_dev` ? @gabeorlanski 

That one seems to work fine. It does still get the discussions (I assume that is intended)

When looking at the `microsoft/phi-1_5` there appears to have been some recent updates, could that be the cause?

Yes @gabeorlanski, the recent updates should make the repo compatible with the library code...tagging @gugarosa to have a look at the [error message](https://github.com/huggingface/transformers/issues/28416#issuecomment-1885140212). 

Until it is fixed you can use phi 1.5 from `susnato/phi-1_5_dev`

The download might be probably hanging because it is trying to find safetensors-based files, whereas Phi-1.5 was not saved with safetensors.

Regarding the loading issues, using:
```
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", trust_remote_code=True)
```

Should be working now regardless of you transformers version.

@gugarosa that fixed it. Thanks so much! Closing the issue