Running huggingface-cli from script
I am using startup scripts on my TPU, and need to authenticate for access to my datasets with  “huggingface-cli cli” as part of the script.Typically something like this should work:printf "myaccesstoken\n" | huggingface-cli loginHowever, this does not work. Any idea how to authenticate as part of a batch script?
2022-05-01T15:32:24Z
You can probably just callHfFolder.save_token()which will save your token to~/.huggingface/tokenLet us know if it worked (also cc@lysandre)
2022-05-02T12:37:19Z
Great. Thanks. This seems to work perfectly in my bash script:python -c “from huggingface_hub.REDACTED_TOKEN import HfFolder; HfFolder.save_token(‘my_token’)”