huggingface-cli login in dockerfile
Hello. I want to use private model in my docker environment.
for that, I need to login in the dockerfile. (to deploy model using entrypoint)
is there anyway to do this?
I copied token file to my /root/.huggingace. but it doesn't work.<|||||>In your dockerfile, you can manually save the token with the following:

```
python -c 'from huggingface_hub import HfFolder; HfFolder.save_token("<TOKEN>")'
```

It will save it in `~/.huggingface/token`. You can check it works with 

```
python -c 'from huggingface_hub import whoami; print(whoami())'
```<|||||>Thank you !

I used `from huggingface_hub.commands.user import _login; _login(token=TOKEN)`, and this worked.
<|||||>Perfect!<|||||>Hello @hyunwoongko 
The `_login` function requires `hf_api` argument, which one did you give?<|||||>Hello @taki0112.  I am using the following script.

```python
from huggingface_hub import HfApi
from huggingface_hub.commands.user import _login

_login(HfApi(), token="YOUR_KEY")
```<|||||>@hyunwoongko Thanks a lot !<|||||>I go through the code but It was not work for me, I think it is regarding new updates, but you can use directly _login from _login.py

```python
from huggingface_hub._login import _login
_login(token='your token as string', add_to_git_credential=False)
```
