Login to HuggingFace Hub if HF_TOKEN is defined in the environment
()
| 59 | |
| 60 | |
| 61 | def hf_login(): |
| 62 | """Login to HuggingFace Hub if HF_TOKEN is defined in the environment""" |
| 63 | hf_token = os.getenv("HF_TOKEN") |
| 64 | if hf_token is not None: |
| 65 | login(token=hf_token) |