tf run_clm.py calls model.get_input_embeddings().weight which does not exist
### System Info

seems to happen on mac, linux, and windows, both python 3.9 and 3.11. currently using stable from pip.

### Who can help?

_No response_

### Information

- [x] The official example scripts
- [ ] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

if you run run_clm.py from scratch it will produce an error saying that embeddings.weight doesn't exist.

https://github.com/huggingface/transformers/blob/e45e756d22206ca8fa9fb057c8c3d8fa79bf81c6/examples/tensorflow/language-modeling/run_clm.py#L486

Looks like it details a temporary workaround, I'm guessing the get_input_embeddings function's contract has changed.

### Expected behavior

I would expect the weight variable to exist.
cc @Rocketknight1 <|||||>I was able to fix it locally by calling embeddings.hidden_size. Not sure if that is correct.<|||||>Hi @wesboyt, can you paste the exact command you called `run_clm.py` with?<|||||>--overwrite_output_dir --do_train --model_type gpt2 --tokenizer_name gpt2-it --train_file encoded.txt --do_eval --dataloader_num_workers 1 --output_dir out --block_size 256 --save_steps 100000 --validation_file features.txt --learning_rate 0.001 --num_train_epochs 1 --optim adamw_torch --per_device_train_batch_size 8 --config_overrides num_hidden_layers=14,n_head=16,vocab_size=13,hidden_size=1024<|||||>from what i see in the debugger the type of the actual embeddings variable is TFSharedEmbeddings

I was able to fix it by using hidden_size it was succesfully training after that change
<|||||>the actual hidden size variable in the debugger did not align with the config overrides hidden_size parameter, it was like 728 or 768 or something along those lines.<|||||>Hi @wesboyt, I can't reproduce the issue here - I was able to train `gpt2` using the TF `run_clm.py` script and didn't encounter these errors. Can you try the command I used and confirm that there isn't some environment issue on your machine?
```python run_clm.py --model_name_or_path gpt2 --output_dir output --dataset_name wikitext --dataset_config_name wikitext-103-raw-v1 --block_size 128```<|||||>Yea that runs for me, maybe its related to some of the other parameters. Its all good i fixed it locally for me and if people encounter it in the future they should be able to find this.<|||||>I will close this, sorry to distract the team. I believe it happened because i used torch adamw inside of tf. Funny how it still trained  after my hiddensize fix.