# TypeError: \_\_init\_\_() got an unexpected keyword argument 'hub\_token'

**URL:** <https://discuss.huggingface.co/t/typeerror-init-got-an-unexpected-keyword-argument-hub-token/19864>\
**Category:** Intermediate\
**Created:** [June 30, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/typeerror-init-got-an-unexpected-keyword-argument-hub-token/19864 "2022-06-30T16:35:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sschet](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sschet](https://discuss.huggingface.co/u/sschet)\
**Post date:** [June 30, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/typeerror-init-got-an-unexpected-keyword-argument-hub-token/19864/1 "2022-06-30T16:35:36Z")

</div>

Hi, in response to the following error:

ValueError: You must login to the Hugging Face hub on this computer by typing `transformers-cli login` and entering your credentials to use `use_auth_token=True`. Alternatively, you can pass your own token as the `use_auth_token` argument

I added the ‘hub\_token’ argument to ‘TrainingArguments’ as in the code below:

```auto
args = TrainingArguments(
    model_checkpoint[19:],
    evaluation_strategy='no',
    save_strategy='epoch',
    learning_rate=2e-5,
    num_train_epochs=3,
    weight_decay=0.01,
    fp16=False,
    push_to_hub=True,
    hub_token='xxxxxxxxxxxx',
)

```

Running this code results in the following error:

TypeError: **init** () got an unexpected keyword argument ‘hub\_token’

Please advise.

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [July 1, 2022, 6:57pm UTC](https://discuss.huggingface.co/t/typeerror-init-got-an-unexpected-keyword-argument-hub-token/19864/2 "2022-07-01T18:57:33Z")

</div>

Try updating your `Transformers` library, it looks like you have an older version.

---

<div class="post-metadata">

**Author:** ![sschet](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sschet](https://discuss.huggingface.co/u/sschet)\
**Post date:** [July 1, 2022, 7:11pm UTC](https://discuss.huggingface.co/t/typeerror-init-got-an-unexpected-keyword-argument-hub-token/19864/3 "2022-07-01T19:11:35Z")

</div>

Simple enough, thank you 😄
