huggingface-hub 0.25.2__tar.gz → 0.26.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of huggingface-hub might be problematic. Click here for more details.

Files changed (125) hide show
  1. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/PKG-INFO +6 -5
  2. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/README.md +4 -4
  3. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/setup.py +3 -2
  4. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/__init__.py +45 -11
  5. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_login.py +172 -33
  6. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/user.py +125 -9
  7. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/constants.py +1 -1
  8. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/errors.py +6 -9
  9. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/file_download.py +2 -372
  10. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/hf_api.py +170 -13
  11. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/hf_file_system.py +3 -3
  12. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/hub_mixin.py +2 -1
  13. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_client.py +500 -145
  14. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_common.py +42 -4
  15. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/_async_client.py +499 -144
  16. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/__init__.py +37 -7
  17. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/audio_classification.py +8 -5
  18. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +9 -7
  19. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/chat_completion.py +23 -4
  20. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/image_classification.py +8 -5
  21. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/image_segmentation.py +9 -7
  22. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/image_to_image.py +7 -5
  23. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/image_to_text.py +4 -4
  24. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/object_detection.py +11 -5
  25. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/summarization.py +11 -13
  26. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/text_classification.py +10 -5
  27. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/text_generation.py +1 -0
  28. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/text_to_audio.py +2 -2
  29. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/text_to_image.py +9 -7
  30. huggingface_hub-0.26.0/src/huggingface_hub/inference/_generated/types/text_to_speech.py +107 -0
  31. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/translation.py +17 -11
  32. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/video_classification.py +2 -2
  33. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/repocard.py +2 -1
  34. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/repocard_data.py +10 -2
  35. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/serialization/_torch.py +7 -4
  36. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/__init__.py +4 -20
  37. huggingface_hub-0.25.2/src/huggingface_hub/utils/_token.py → huggingface_hub-0.26.0/src/huggingface_hub/utils/_auth.py +86 -3
  38. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_headers.py +1 -1
  39. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_hf_folder.py +1 -1
  40. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_http.py +10 -4
  41. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_runtime.py +1 -10
  42. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/PKG-INFO +6 -5
  43. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/SOURCES.txt +2 -2
  44. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/requires.txt +6 -7
  45. huggingface_hub-0.25.2/src/huggingface_hub/inference/_templating.py +0 -102
  46. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/LICENSE +0 -0
  47. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/MANIFEST.in +0 -0
  48. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/pyproject.toml +0 -0
  49. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/setup.cfg +0 -0
  50. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_commit_api.py +0 -0
  51. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_commit_scheduler.py +0 -0
  52. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_inference_endpoints.py +0 -0
  53. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_local_folder.py +0 -0
  54. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_multi_commits.py +0 -0
  55. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_snapshot_download.py +0 -0
  56. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_space_api.py +0 -0
  57. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_tensorboard_logger.py +0 -0
  58. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_upload_large_folder.py +0 -0
  59. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_webhooks_payload.py +0 -0
  60. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/_webhooks_server.py +0 -0
  61. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/__init__.py +0 -0
  62. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/_cli_utils.py +0 -0
  63. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/delete_cache.py +0 -0
  64. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/download.py +0 -0
  65. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/env.py +0 -0
  66. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/huggingface_cli.py +0 -0
  67. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/lfs.py +0 -0
  68. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/repo_files.py +0 -0
  69. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/scan_cache.py +0 -0
  70. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/tag.py +0 -0
  71. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/upload.py +0 -0
  72. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/upload_large_folder.py +0 -0
  73. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/commands/version.py +0 -0
  74. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/community.py +0 -0
  75. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/fastai_utils.py +0 -0
  76. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/__init__.py +0 -0
  77. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/__init__.py +0 -0
  78. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/audio_to_audio.py +0 -0
  79. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/base.py +0 -0
  80. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/depth_estimation.py +0 -0
  81. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/document_question_answering.py +0 -0
  82. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/feature_extraction.py +0 -0
  83. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/fill_mask.py +0 -0
  84. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/question_answering.py +0 -0
  85. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/sentence_similarity.py +0 -0
  86. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/table_question_answering.py +0 -0
  87. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/text2text_generation.py +0 -0
  88. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/token_classification.py +0 -0
  89. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/visual_question_answering.py +0 -0
  90. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/zero_shot_classification.py +0 -0
  91. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +0 -0
  92. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +0 -0
  93. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/inference_api.py +0 -0
  94. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/keras_mixin.py +0 -0
  95. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/lfs.py +0 -0
  96. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/repository.py +0 -0
  97. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/serialization/__init__.py +0 -0
  98. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/serialization/_base.py +0 -0
  99. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/serialization/_tensorflow.py +0 -0
  100. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/templates/datasetcard_template.md +0 -0
  101. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/templates/modelcard_template.md +0 -0
  102. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_cache_assets.py +0 -0
  103. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_cache_manager.py +0 -0
  104. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_chunk_utils.py +0 -0
  105. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_datetime.py +0 -0
  106. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_deprecation.py +0 -0
  107. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_experimental.py +0 -0
  108. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_fixes.py +0 -0
  109. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_git_credential.py +0 -0
  110. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_lfs.py +0 -0
  111. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_pagination.py +0 -0
  112. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_paths.py +0 -0
  113. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_safetensors.py +0 -0
  114. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_subprocess.py +0 -0
  115. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_telemetry.py +0 -0
  116. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_typing.py +0 -0
  117. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/_validators.py +0 -0
  118. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/endpoint_helpers.py +0 -0
  119. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/insecure_hashlib.py +0 -0
  120. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/logging.py +0 -0
  121. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/sha.py +0 -0
  122. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub/utils/tqdm.py +0 -0
  123. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/dependency_links.txt +0 -0
  124. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/entry_points.txt +0 -0
  125. {huggingface_hub-0.25.2 → huggingface_hub-0.26.0}/src/huggingface_hub.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface_hub
3
- Version: 0.25.2
3
+ Version: 0.26.0
4
4
  Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
5
  Home-page: https://github.com/huggingface/huggingface_hub
6
6
  Author: Hugging Face, Inc.
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.8
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
22
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
24
  Requires-Python: >=3.8.0
24
25
  Description-Content-Type: text/markdown
@@ -57,10 +58,10 @@ License-File: LICENSE
57
58
  <h4 align="center">
58
59
  <p>
59
60
  <b>English</b> |
60
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
61
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
62
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국어</a> |
63
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
61
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_de.md">Deutsch</a> |
62
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_hi.md">हिंदी</a> |
63
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_ko.md">한국어</a> |
64
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_cn.md">中文(简体)</a>
64
65
  <p>
65
66
  </h4>
66
67
 
@@ -19,10 +19,10 @@
19
19
  <h4 align="center">
20
20
  <p>
21
21
  <b>English</b> |
22
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_de.md">Deutsch</a> |
23
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_hi.md">हिंदी</a> |
24
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_ko.md">한국어</a> |
25
- <a href="https://github.com/huggingface/huggingface_hub/blob/main/README_cn.md">中文(简体)</a>
22
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_de.md">Deutsch</a> |
23
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_hi.md">हिंदी</a> |
24
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_ko.md">한국어</a> |
25
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_cn.md">中文(简体)</a>
26
26
  <p>
27
27
  </h4>
28
28
 
@@ -29,7 +29,6 @@ extras["cli"] = [
29
29
 
30
30
  extras["inference"] = [
31
31
  "aiohttp", # for AsyncInferenceClient
32
- "minijinja>=1.0", # for chat-completion if not TGI-served
33
32
  ]
34
33
 
35
34
  extras["torch"] = [
@@ -74,7 +73,7 @@ extras["testing"] = (
74
73
  "urllib3<2.0", # VCR.py broken with urllib3 2.0 (see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html)
75
74
  "soundfile",
76
75
  "Pillow",
77
- "gradio", # to test webhooks
76
+ "gradio>=4.0.0", # to test webhooks # pin to avoid issue on Python3.12
78
77
  "numpy", # for embeddings
79
78
  "fastapi", # To build the documentation
80
79
  ]
@@ -95,6 +94,7 @@ extras["typing"] = [
95
94
  extras["quality"] = [
96
95
  "ruff>=0.5.0",
97
96
  "mypy==1.5.1",
97
+ "libcst==1.4.0",
98
98
  ]
99
99
 
100
100
  extras["all"] = extras["testing"] + extras["quality"] + extras["typing"]
@@ -133,6 +133,7 @@ setup(
133
133
  "Programming Language :: Python :: 3.9",
134
134
  "Programming Language :: Python :: 3.10",
135
135
  "Programming Language :: Python :: 3.11",
136
+ "Programming Language :: Python :: 3.12",
136
137
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
137
138
  ],
138
139
  include_package_data=True,
@@ -46,7 +46,7 @@ import sys
46
46
  from typing import TYPE_CHECKING
47
47
 
48
48
 
49
- __version__ = "0.25.2"
49
+ __version__ = "0.26.0"
50
50
 
51
51
  # Alphabetical order of definitions is ensured in tests
52
52
  # WARNING: any comment added in this dictionary definition will be lost when
@@ -63,6 +63,8 @@ _SUBMOD_ATTRS = {
63
63
  "InferenceEndpointType",
64
64
  ],
65
65
  "_login": [
66
+ "auth_list",
67
+ "auth_switch",
66
68
  "interpreter_login",
67
69
  "login",
68
70
  "logout",
@@ -129,7 +131,6 @@ _SUBMOD_ATTRS = {
129
131
  "file_download": [
130
132
  "HfFileMetadata",
131
133
  "_CACHED_NO_EXIST",
132
- "cached_download",
133
134
  "get_hf_file_metadata",
134
135
  "hf_hub_download",
135
136
  "hf_hub_url",
@@ -215,6 +216,7 @@ _SUBMOD_ATTRS = {
215
216
  "list_metrics",
216
217
  "list_models",
217
218
  "list_organization_members",
219
+ "list_papers",
218
220
  "list_pending_access_requests",
219
221
  "list_rejected_access_requests",
220
222
  "list_repo_commits",
@@ -229,6 +231,7 @@ _SUBMOD_ATTRS = {
229
231
  "merge_pull_request",
230
232
  "model_info",
231
233
  "move_repo",
234
+ "paper_info",
232
235
  "parse_safetensors_file_metadata",
233
236
  "pause_inference_endpoint",
234
237
  "pause_space",
@@ -280,9 +283,11 @@ _SUBMOD_ATTRS = {
280
283
  "inference._generated.types": [
281
284
  "AudioClassificationInput",
282
285
  "AudioClassificationOutputElement",
286
+ "AudioClassificationOutputTransform",
283
287
  "AudioClassificationParameters",
284
288
  "AudioToAudioInput",
285
289
  "AudioToAudioOutputElement",
290
+ "AutomaticSpeechRecognitionEarlyStoppingEnum",
286
291
  "AutomaticSpeechRecognitionGenerationParameters",
287
292
  "AutomaticSpeechRecognitionInput",
288
293
  "AutomaticSpeechRecognitionOutput",
@@ -294,8 +299,8 @@ _SUBMOD_ATTRS = {
294
299
  "ChatCompletionInputGrammarType",
295
300
  "ChatCompletionInputMessage",
296
301
  "ChatCompletionInputMessageChunk",
297
- "ChatCompletionInputTool",
298
- "ChatCompletionInputToolTypeClass",
302
+ "ChatCompletionInputStreamOptions",
303
+ "ChatCompletionInputToolType",
299
304
  "ChatCompletionInputURL",
300
305
  "ChatCompletionOutput",
301
306
  "ChatCompletionOutputComplete",
@@ -314,6 +319,7 @@ _SUBMOD_ATTRS = {
314
319
  "ChatCompletionStreamOutputLogprob",
315
320
  "ChatCompletionStreamOutputLogprobs",
316
321
  "ChatCompletionStreamOutputTopLogprob",
322
+ "ChatCompletionStreamOutputUsage",
317
323
  "DepthEstimationInput",
318
324
  "DepthEstimationOutput",
319
325
  "DocumentQuestionAnsweringInput",
@@ -326,6 +332,7 @@ _SUBMOD_ATTRS = {
326
332
  "FillMaskParameters",
327
333
  "ImageClassificationInput",
328
334
  "ImageClassificationOutputElement",
335
+ "ImageClassificationOutputTransform",
329
336
  "ImageClassificationParameters",
330
337
  "ImageSegmentationInput",
331
338
  "ImageSegmentationOutputElement",
@@ -334,6 +341,7 @@ _SUBMOD_ATTRS = {
334
341
  "ImageToImageOutput",
335
342
  "ImageToImageParameters",
336
343
  "ImageToImageTargetSize",
344
+ "ImageToTextEarlyStoppingEnum",
337
345
  "ImageToTextGenerationParameters",
338
346
  "ImageToTextInput",
339
347
  "ImageToTextOutput",
@@ -348,9 +356,9 @@ _SUBMOD_ATTRS = {
348
356
  "QuestionAnsweringParameters",
349
357
  "SentenceSimilarityInput",
350
358
  "SentenceSimilarityInputData",
351
- "SummarizationGenerationParameters",
352
359
  "SummarizationInput",
353
360
  "SummarizationOutput",
361
+ "SummarizationParameters",
354
362
  "TableQuestionAnsweringInput",
355
363
  "TableQuestionAnsweringInputData",
356
364
  "TableQuestionAnsweringOutputElement",
@@ -359,6 +367,7 @@ _SUBMOD_ATTRS = {
359
367
  "Text2TextGenerationParameters",
360
368
  "TextClassificationInput",
361
369
  "TextClassificationOutputElement",
370
+ "TextClassificationOutputTransform",
362
371
  "TextClassificationParameters",
363
372
  "TextGenerationInput",
364
373
  "TextGenerationInputGenerateParameters",
@@ -371,6 +380,7 @@ _SUBMOD_ATTRS = {
371
380
  "TextGenerationStreamOutput",
372
381
  "TextGenerationStreamOutputStreamDetails",
373
382
  "TextGenerationStreamOutputToken",
383
+ "TextToAudioEarlyStoppingEnum",
374
384
  "TextToAudioGenerationParameters",
375
385
  "TextToAudioInput",
376
386
  "TextToAudioOutput",
@@ -379,14 +389,21 @@ _SUBMOD_ATTRS = {
379
389
  "TextToImageOutput",
380
390
  "TextToImageParameters",
381
391
  "TextToImageTargetSize",
392
+ "TextToSpeechEarlyStoppingEnum",
393
+ "TextToSpeechGenerationParameters",
394
+ "TextToSpeechInput",
395
+ "TextToSpeechOutput",
396
+ "TextToSpeechParameters",
382
397
  "TokenClassificationInput",
383
398
  "TokenClassificationOutputElement",
384
399
  "TokenClassificationParameters",
385
- "TranslationGenerationParameters",
400
+ "ToolElement",
386
401
  "TranslationInput",
387
402
  "TranslationOutput",
403
+ "TranslationParameters",
388
404
  "VideoClassificationInput",
389
405
  "VideoClassificationOutputElement",
406
+ "VideoClassificationOutputTransform",
390
407
  "VideoClassificationParameters",
391
408
  "VisualQuestionAnsweringInput",
392
409
  "VisualQuestionAnsweringInputData",
@@ -577,6 +594,8 @@ if TYPE_CHECKING: # pragma: no cover
577
594
  InferenceEndpointType, # noqa: F401
578
595
  )
579
596
  from ._login import (
597
+ auth_list, # noqa: F401
598
+ auth_switch, # noqa: F401
580
599
  interpreter_login, # noqa: F401
581
600
  login, # noqa: F401
582
601
  logout, # noqa: F401
@@ -639,7 +658,6 @@ if TYPE_CHECKING: # pragma: no cover
639
658
  from .file_download import (
640
659
  _CACHED_NO_EXIST, # noqa: F401
641
660
  HfFileMetadata, # noqa: F401
642
- cached_download, # noqa: F401
643
661
  get_hf_file_metadata, # noqa: F401
644
662
  hf_hub_download, # noqa: F401
645
663
  hf_hub_url, # noqa: F401
@@ -725,6 +743,7 @@ if TYPE_CHECKING: # pragma: no cover
725
743
  list_metrics, # noqa: F401
726
744
  list_models, # noqa: F401
727
745
  list_organization_members, # noqa: F401
746
+ list_papers, # noqa: F401
728
747
  list_pending_access_requests, # noqa: F401
729
748
  list_rejected_access_requests, # noqa: F401
730
749
  list_repo_commits, # noqa: F401
@@ -739,6 +758,7 @@ if TYPE_CHECKING: # pragma: no cover
739
758
  merge_pull_request, # noqa: F401
740
759
  model_info, # noqa: F401
741
760
  move_repo, # noqa: F401
761
+ paper_info, # noqa: F401
742
762
  parse_safetensors_file_metadata, # noqa: F401
743
763
  pause_inference_endpoint, # noqa: F401
744
764
  pause_space, # noqa: F401
@@ -788,9 +808,11 @@ if TYPE_CHECKING: # pragma: no cover
788
808
  from .inference._generated.types import (
789
809
  AudioClassificationInput, # noqa: F401
790
810
  AudioClassificationOutputElement, # noqa: F401
811
+ AudioClassificationOutputTransform, # noqa: F401
791
812
  AudioClassificationParameters, # noqa: F401
792
813
  AudioToAudioInput, # noqa: F401
793
814
  AudioToAudioOutputElement, # noqa: F401
815
+ AutomaticSpeechRecognitionEarlyStoppingEnum, # noqa: F401
794
816
  AutomaticSpeechRecognitionGenerationParameters, # noqa: F401
795
817
  AutomaticSpeechRecognitionInput, # noqa: F401
796
818
  AutomaticSpeechRecognitionOutput, # noqa: F401
@@ -802,8 +824,8 @@ if TYPE_CHECKING: # pragma: no cover
802
824
  ChatCompletionInputGrammarType, # noqa: F401
803
825
  ChatCompletionInputMessage, # noqa: F401
804
826
  ChatCompletionInputMessageChunk, # noqa: F401
805
- ChatCompletionInputTool, # noqa: F401
806
- ChatCompletionInputToolTypeClass, # noqa: F401
827
+ ChatCompletionInputStreamOptions, # noqa: F401
828
+ ChatCompletionInputToolType, # noqa: F401
807
829
  ChatCompletionInputURL, # noqa: F401
808
830
  ChatCompletionOutput, # noqa: F401
809
831
  ChatCompletionOutputComplete, # noqa: F401
@@ -822,6 +844,7 @@ if TYPE_CHECKING: # pragma: no cover
822
844
  ChatCompletionStreamOutputLogprob, # noqa: F401
823
845
  ChatCompletionStreamOutputLogprobs, # noqa: F401
824
846
  ChatCompletionStreamOutputTopLogprob, # noqa: F401
847
+ ChatCompletionStreamOutputUsage, # noqa: F401
825
848
  DepthEstimationInput, # noqa: F401
826
849
  DepthEstimationOutput, # noqa: F401
827
850
  DocumentQuestionAnsweringInput, # noqa: F401
@@ -834,6 +857,7 @@ if TYPE_CHECKING: # pragma: no cover
834
857
  FillMaskParameters, # noqa: F401
835
858
  ImageClassificationInput, # noqa: F401
836
859
  ImageClassificationOutputElement, # noqa: F401
860
+ ImageClassificationOutputTransform, # noqa: F401
837
861
  ImageClassificationParameters, # noqa: F401
838
862
  ImageSegmentationInput, # noqa: F401
839
863
  ImageSegmentationOutputElement, # noqa: F401
@@ -842,6 +866,7 @@ if TYPE_CHECKING: # pragma: no cover
842
866
  ImageToImageOutput, # noqa: F401
843
867
  ImageToImageParameters, # noqa: F401
844
868
  ImageToImageTargetSize, # noqa: F401
869
+ ImageToTextEarlyStoppingEnum, # noqa: F401
845
870
  ImageToTextGenerationParameters, # noqa: F401
846
871
  ImageToTextInput, # noqa: F401
847
872
  ImageToTextOutput, # noqa: F401
@@ -856,9 +881,9 @@ if TYPE_CHECKING: # pragma: no cover
856
881
  QuestionAnsweringParameters, # noqa: F401
857
882
  SentenceSimilarityInput, # noqa: F401
858
883
  SentenceSimilarityInputData, # noqa: F401
859
- SummarizationGenerationParameters, # noqa: F401
860
884
  SummarizationInput, # noqa: F401
861
885
  SummarizationOutput, # noqa: F401
886
+ SummarizationParameters, # noqa: F401
862
887
  TableQuestionAnsweringInput, # noqa: F401
863
888
  TableQuestionAnsweringInputData, # noqa: F401
864
889
  TableQuestionAnsweringOutputElement, # noqa: F401
@@ -867,6 +892,7 @@ if TYPE_CHECKING: # pragma: no cover
867
892
  Text2TextGenerationParameters, # noqa: F401
868
893
  TextClassificationInput, # noqa: F401
869
894
  TextClassificationOutputElement, # noqa: F401
895
+ TextClassificationOutputTransform, # noqa: F401
870
896
  TextClassificationParameters, # noqa: F401
871
897
  TextGenerationInput, # noqa: F401
872
898
  TextGenerationInputGenerateParameters, # noqa: F401
@@ -879,6 +905,7 @@ if TYPE_CHECKING: # pragma: no cover
879
905
  TextGenerationStreamOutput, # noqa: F401
880
906
  TextGenerationStreamOutputStreamDetails, # noqa: F401
881
907
  TextGenerationStreamOutputToken, # noqa: F401
908
+ TextToAudioEarlyStoppingEnum, # noqa: F401
882
909
  TextToAudioGenerationParameters, # noqa: F401
883
910
  TextToAudioInput, # noqa: F401
884
911
  TextToAudioOutput, # noqa: F401
@@ -887,14 +914,21 @@ if TYPE_CHECKING: # pragma: no cover
887
914
  TextToImageOutput, # noqa: F401
888
915
  TextToImageParameters, # noqa: F401
889
916
  TextToImageTargetSize, # noqa: F401
917
+ TextToSpeechEarlyStoppingEnum, # noqa: F401
918
+ TextToSpeechGenerationParameters, # noqa: F401
919
+ TextToSpeechInput, # noqa: F401
920
+ TextToSpeechOutput, # noqa: F401
921
+ TextToSpeechParameters, # noqa: F401
890
922
  TokenClassificationInput, # noqa: F401
891
923
  TokenClassificationOutputElement, # noqa: F401
892
924
  TokenClassificationParameters, # noqa: F401
893
- TranslationGenerationParameters, # noqa: F401
925
+ ToolElement, # noqa: F401
894
926
  TranslationInput, # noqa: F401
895
927
  TranslationOutput, # noqa: F401
928
+ TranslationParameters, # noqa: F401
896
929
  VideoClassificationInput, # noqa: F401
897
930
  VideoClassificationOutputElement, # noqa: F401
931
+ VideoClassificationOutputTransform, # noqa: F401
898
932
  VideoClassificationParameters, # noqa: F401
899
933
  VisualQuestionAnsweringInput, # noqa: F401
900
934
  VisualQuestionAnsweringInputData, # noqa: F401
@@ -33,7 +33,15 @@ from .utils import (
33
33
  set_git_credential,
34
34
  unset_git_credential,
35
35
  )
36
- from .utils._token import _get_token_from_environment, _get_token_from_google_colab
36
+ from .utils._auth import (
37
+ _get_token_by_name,
38
+ _get_token_from_environment,
39
+ _get_token_from_file,
40
+ _get_token_from_google_colab,
41
+ _save_stored_tokens,
42
+ _save_token,
43
+ get_stored_tokens,
44
+ )
37
45
 
38
46
 
39
47
  logger = logging.get_logger(__name__)
@@ -102,7 +110,7 @@ def login(
102
110
  """
103
111
  if token is not None:
104
112
  if not add_to_git_credential:
105
- print(
113
+ logger.info(
106
114
  "The token has not been saved to the git credentials helper. Pass "
107
115
  "`add_to_git_credential=True` in this function directly or "
108
116
  "`--add-to-git-credential` if using via `huggingface-cli` if "
@@ -115,24 +123,35 @@ def login(
115
123
  interpreter_login(new_session=new_session, write_permission=write_permission)
116
124
 
117
125
 
118
- def logout() -> None:
126
+ def logout(token_name: Optional[str] = None) -> None:
119
127
  """Logout the machine from the Hub.
120
128
 
121
129
  Token is deleted from the machine and removed from git credential.
130
+
131
+ Args:
132
+ token_name (`str`, *optional*):
133
+ Name of the access token to logout from. If `None`, will logout from all saved access tokens.
134
+ Raises:
135
+ [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError):
136
+ If the access token name is not found.
122
137
  """
123
- if get_token() is None:
124
- print("Not logged in!")
138
+ if get_token() is None and not get_stored_tokens(): # No active token and no saved access tokens
139
+ logger.warning("Not logged in!")
125
140
  return
141
+ if not token_name:
142
+ # Delete all saved access tokens and token
143
+ for file_path in (constants.HF_TOKEN_PATH, constants.HF_STORED_TOKENS_PATH):
144
+ try:
145
+ Path(file_path).unlink()
146
+ except FileNotFoundError:
147
+ pass
148
+ logger.info("Successfully logged out from all access tokens.")
149
+ else:
150
+ _logout_from_token(token_name)
151
+ logger.info(f"Successfully logged out from access token: {token_name}.")
126
152
 
127
- # Delete token from git credentials
128
153
  unset_git_credential()
129
154
 
130
- # Delete token file
131
- try:
132
- Path(constants.HF_TOKEN_PATH).unlink()
133
- except FileNotFoundError:
134
- pass
135
-
136
155
  # Check if still logged in
137
156
  if _get_token_from_google_colab() is not None:
138
157
  raise EnvironmentError(
@@ -145,7 +164,70 @@ def logout() -> None:
145
164
  "To log out, you must clear out both `HF_TOKEN` and `HUGGING_FACE_HUB_TOKEN` environment variables."
146
165
  )
147
166
 
148
- print("Successfully logged out.")
167
+
168
+ def auth_switch(token_name: str, add_to_git_credential: bool = False) -> None:
169
+ """Switch to a different access token.
170
+
171
+ Args:
172
+ token_name (`str`):
173
+ Name of the access token to switch to.
174
+ add_to_git_credential (`bool`, defaults to `False`):
175
+ If `True`, token will be set as git credential. If no git credential helper
176
+ is configured, a warning will be displayed to the user. If `token` is `None`,
177
+ the value of `add_to_git_credential` is ignored and will be prompted again
178
+ to the end user.
179
+
180
+ Raises:
181
+ [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError):
182
+ If the access token name is not found.
183
+ """
184
+ token = _get_token_by_name(token_name)
185
+ if not token:
186
+ raise ValueError(f"Access token {token_name} not found in {constants.HF_STORED_TOKENS_PATH}")
187
+ # Write token to HF_TOKEN_PATH
188
+ _set_active_token(token_name, add_to_git_credential)
189
+ logger.info(f"The current active token is: {token_name}")
190
+ token_from_environment = _get_token_from_environment()
191
+ if token_from_environment is not None and token_from_environment != token:
192
+ logger.warning(
193
+ "The environment variable `HF_TOKEN` is set and will override the access token you've just switched to."
194
+ )
195
+
196
+
197
+ def auth_list() -> None:
198
+ """List all stored access tokens."""
199
+ tokens = get_stored_tokens()
200
+
201
+ if not tokens:
202
+ logger.info("No access tokens found.")
203
+ return
204
+ # Find current token
205
+ current_token = get_token()
206
+ current_token_name = None
207
+ for token_name in tokens:
208
+ if tokens.get(token_name) == current_token:
209
+ current_token_name = token_name
210
+ # Print header
211
+ max_offset = max(len("token"), max(len(token) for token in tokens)) + 2
212
+ print(f" {{:<{max_offset}}}| {{:<15}}".format("name", "token"))
213
+ print("-" * (max_offset + 2) + "|" + "-" * 15)
214
+
215
+ # Print saved access tokens
216
+ for token_name in tokens:
217
+ token = tokens.get(token_name, "<not set>")
218
+ masked_token = f"{token[:3]}****{token[-4:]}" if token != "<not set>" else token
219
+ is_current = "*" if token == current_token else " "
220
+
221
+ print(f"{is_current} {{:<{max_offset}}}| {{:<15}}".format(token_name, masked_token))
222
+
223
+ if _get_token_from_environment():
224
+ logger.warning(
225
+ "\nNote: Environment variable `HF_TOKEN` is set and is the current active token independently from the stored tokens listed above."
226
+ )
227
+ elif current_token_name is None:
228
+ logger.warning(
229
+ "\nNote: No active token is set and no environment variable `HF_TOKEN` is found. Use `huggingface-cli login` to log in."
230
+ )
149
231
 
150
232
 
151
233
  ###
@@ -171,27 +253,33 @@ def interpreter_login(new_session: bool = True, write_permission: bool = False)
171
253
 
172
254
  """
173
255
  if not new_session and _current_token_okay(write_permission=write_permission):
174
- print("User is already logged in.")
256
+ logger.info("User is already logged in.")
175
257
  return
176
258
 
177
259
  from .commands.delete_cache import _ask_for_confirmation_no_tui
178
260
 
179
261
  print(_HF_LOGO_ASCII)
180
262
  if get_token() is not None:
181
- print(
263
+ logger.info(
182
264
  " A token is already saved on your machine. Run `huggingface-cli"
183
265
  " whoami` to get more information or `huggingface-cli logout` if you want"
184
266
  " to log out."
185
267
  )
186
- print(" Setting a new token will erase the existing one.")
268
+ logger.info(" Setting a new token will erase the existing one.")
187
269
 
188
- print(" To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .")
270
+ logger.info(
271
+ " To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens ."
272
+ )
189
273
  if os.name == "nt":
190
- print("Token can be pasted using 'Right-Click'.")
274
+ logger.info("Token can be pasted using 'Right-Click'.")
191
275
  token = getpass("Enter your token (input will not be visible): ")
192
276
  add_to_git_credential = _ask_for_confirmation_no_tui("Add token as git credential?")
193
277
 
194
- _login(token=token, add_to_git_credential=add_to_git_credential, write_permission=write_permission)
278
+ _login(
279
+ token=token,
280
+ add_to_git_credential=add_to_git_credential,
281
+ write_permission=write_permission,
282
+ )
195
283
 
196
284
 
197
285
  ###
@@ -243,7 +331,7 @@ def notebook_login(new_session: bool = True, write_permission: bool = False) ->
243
331
  " Colab) and you need the `ipywidgets` module: `pip install ipywidgets`."
244
332
  )
245
333
  if not new_session and _current_token_okay(write_permission=write_permission):
246
- print("User is already logged in.")
334
+ logger.info("User is already logged in.")
247
335
  return
248
336
 
249
337
  box_layout = widgets.Layout(display="flex", flex_flow="column", align_items="center", width="50%")
@@ -296,38 +384,89 @@ def notebook_login(new_session: bool = True, write_permission: bool = False) ->
296
384
  ###
297
385
 
298
386
 
299
- def _login(token: str, add_to_git_credential: bool, write_permission: bool = False) -> None:
300
- from .hf_api import get_token_permission # avoid circular import
387
+ def _login(
388
+ token: str,
389
+ add_to_git_credential: bool,
390
+ write_permission: bool = False,
391
+ ) -> None:
392
+ from .hf_api import whoami # avoid circular import
301
393
 
302
394
  if token.startswith("api_org"):
303
395
  raise ValueError("You must use your personal account token, not an organization token.")
304
396
 
305
- permission = get_token_permission(token)
306
- if permission is None:
307
- raise ValueError("Invalid token passed!")
308
- elif write_permission and permission != "write":
397
+ token_info = whoami(token)
398
+ permission = token_info["auth"]["accessToken"]["role"]
399
+ if write_permission and permission != "write":
309
400
  raise ValueError(
310
401
  "Token is valid but is 'read-only' and a 'write' token is required.\nPlease provide a new token with"
311
402
  " correct permission."
312
403
  )
313
- print(f"Token is valid (permission: {permission}).")
404
+ logger.info(f"Token is valid (permission: {permission}).")
405
+
406
+ token_name = token_info["auth"]["accessToken"]["displayName"]
407
+ # Store token locally
408
+ _save_token(token=token, token_name=token_name)
409
+ # Set active token
410
+ _set_active_token(token_name=token_name, add_to_git_credential=add_to_git_credential)
411
+ logger.info("Login successful.")
412
+ if _get_token_from_environment():
413
+ logger.warning(
414
+ "Note: Environment variable`HF_TOKEN` is set and is the current active token independently from the token you've just configured."
415
+ )
416
+ else:
417
+ logger.info(f"The current active token is: `{token_name}`")
418
+
314
419
 
420
+ def _logout_from_token(token_name: str) -> None:
421
+ """Logout from a specific access token.
422
+
423
+ Args:
424
+ token_name (`str`):
425
+ The name of the access token to logout from.
426
+ Raises:
427
+ [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError):
428
+ If the access token name is not found.
429
+ """
430
+ stored_tokens = get_stored_tokens()
431
+ # If there is no access tokens saved or the access token name is not found, do nothing
432
+ if not stored_tokens or token_name not in stored_tokens:
433
+ return
434
+
435
+ token = stored_tokens.pop(token_name)
436
+ _save_stored_tokens(stored_tokens)
437
+
438
+ if token == _get_token_from_file():
439
+ logger.warning(f"Active token '{token_name}' has been deleted.")
440
+ Path(constants.HF_TOKEN_PATH).unlink(missing_ok=True)
441
+
442
+
443
+ def _set_active_token(
444
+ token_name: str,
445
+ add_to_git_credential: bool,
446
+ ) -> None:
447
+ """Set the active access token.
448
+
449
+ Args:
450
+ token_name (`str`):
451
+ The name of the token to set as active.
452
+ """
453
+ token = _get_token_by_name(token_name)
454
+ if not token:
455
+ raise ValueError(f"Token {token_name} not found in {constants.HF_STORED_TOKENS_PATH}")
315
456
  if add_to_git_credential:
316
457
  if _is_git_credential_helper_configured():
317
458
  set_git_credential(token)
318
- print(
459
+ logger.info(
319
460
  "Your token has been saved in your configured git credential helpers"
320
461
  + f" ({','.join(list_credential_helpers())})."
321
462
  )
322
463
  else:
323
- print("Token has not been saved to git credential helper.")
324
-
325
- # Save token
464
+ logger.warning("Token has not been saved to git credential helper.")
465
+ # Write token to HF_TOKEN_PATH
326
466
  path = Path(constants.HF_TOKEN_PATH)
327
467
  path.parent.mkdir(parents=True, exist_ok=True)
328
468
  path.write_text(token)
329
- print(f"Your token has been saved to {constants.HF_TOKEN_PATH}")
330
- print("Login successful")
469
+ logger.info(f"Your token has been saved to {constants.HF_TOKEN_PATH}")
331
470
 
332
471
 
333
472
  def _current_token_okay(write_permission: bool = False):