huggingface-hub 1.0.0rc3__tar.gz → 1.0.0rc4__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.
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/PKG-INFO +1 -1
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/__init__.py +1 -1
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_login.py +1 -1
- huggingface_hub-1.0.0rc4/src/huggingface_hub/cli/_cli_utils.py +170 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/auth.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/cache.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/download.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/hf.py +2 -1
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/repo.py +1 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/upload_large_folder.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/constants.py +4 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/dataclasses.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/__init__.py +2 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_cache_manager.py +1 -1
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_http.py +2 -2
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_runtime.py +48 -1
- huggingface_hub-1.0.0rc4/src/huggingface_hub/utils/_terminal.py +69 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/PKG-INFO +1 -1
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/SOURCES.txt +1 -0
- huggingface_hub-1.0.0rc3/src/huggingface_hub/cli/_cli_utils.py +0 -152
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/LICENSE +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/MANIFEST.in +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/README.md +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/pyproject.toml +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/setup.cfg +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/setup.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_commit_api.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_commit_scheduler.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_inference_endpoints.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_jobs_api.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_local_folder.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_oauth.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_snapshot_download.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_space_api.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_tensorboard_logger.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_upload_large_folder.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_webhooks_payload.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_webhooks_server.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/jobs.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/lfs.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/repo_files.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/system.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/upload.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/community.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/errors.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/fastai_utils.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/file_download.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/hf_api.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/hf_file_system.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/hub_mixin.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_client.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_common.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/_async_client.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/audio_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/audio_to_audio.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/base.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/chat_completion.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/depth_estimation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/document_question_answering.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/feature_extraction.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/fill_mask.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/image_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/image_segmentation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/image_to_image.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/image_to_text.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/image_to_video.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/object_detection.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/question_answering.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/sentence_similarity.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/summarization.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/table_question_answering.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text2text_generation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_generation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_to_audio.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_to_image.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_to_speech.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/text_to_video.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/token_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/translation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/video_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/visual_question_answering.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/zero_shot_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/_cli_hacks.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/agent.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/cli.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/constants.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/mcp_client.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/types.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_mcp/utils.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/_common.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/black_forest_labs.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/cerebras.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/cohere.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/fal_ai.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/featherless_ai.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/fireworks_ai.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/groq.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/hf_inference.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/hyperbolic.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/nebius.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/novita.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/nscale.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/openai.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/publicai.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/replicate.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/sambanova.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/scaleway.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/together.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/inference/_providers/zai_org.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/lfs.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/py.typed +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/repocard.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/repocard_data.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/serialization/__init__.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/serialization/_base.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/serialization/_dduf.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/serialization/_torch.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/templates/datasetcard_template.md +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/templates/modelcard_template.md +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_auth.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_cache_assets.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_chunk_utils.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_datetime.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_deprecation.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_dotenv.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_experimental.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_fixes.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_git_credential.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_headers.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_lfs.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_pagination.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_paths.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_safetensors.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_subprocess.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_telemetry.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_typing.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_validators.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_xet.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_xet_progress_reporting.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/endpoint_helpers.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/insecure_hashlib.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/logging.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/sha.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/tqdm.py +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/dependency_links.txt +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/entry_points.txt +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/requires.txt +0 -0
- {huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/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: 1.0.
|
|
3
|
+
Version: 1.0.0rc4
|
|
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.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Contains CLI utilities (styling, helpers)."""
|
|
15
|
+
|
|
16
|
+
import importlib.metadata
|
|
17
|
+
import os
|
|
18
|
+
import time
|
|
19
|
+
from enum import Enum
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
from typing import TYPE_CHECKING, Annotated, Optional
|
|
22
|
+
|
|
23
|
+
import click
|
|
24
|
+
import typer
|
|
25
|
+
|
|
26
|
+
from huggingface_hub import __version__, constants
|
|
27
|
+
from huggingface_hub.utils import ANSI, get_session, hf_raise_for_status, installation_method, logging
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
logger = logging.get_logger()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if TYPE_CHECKING:
|
|
34
|
+
from huggingface_hub.hf_api import HfApi
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_hf_api(token: Optional[str] = None) -> "HfApi":
|
|
38
|
+
# Import here to avoid circular import
|
|
39
|
+
from huggingface_hub.hf_api import HfApi
|
|
40
|
+
|
|
41
|
+
return HfApi(token=token, library_name="hf", library_version=__version__)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
#### TYPER UTILS
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AlphabeticalMixedGroup(typer.core.TyperGroup):
|
|
48
|
+
"""
|
|
49
|
+
Typer Group that lists commands and sub-apps mixed and alphabetically.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def list_commands(self, ctx: click.Context) -> list[str]: # type: ignore[name-defined]
|
|
53
|
+
# click.Group stores both commands and sub-groups in `self.commands`
|
|
54
|
+
return sorted(self.commands.keys())
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def typer_factory(help: str) -> typer.Typer:
|
|
58
|
+
return typer.Typer(
|
|
59
|
+
help=help,
|
|
60
|
+
add_completion=True,
|
|
61
|
+
rich_markup_mode=None,
|
|
62
|
+
no_args_is_help=True,
|
|
63
|
+
cls=AlphabeticalMixedGroup,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class RepoType(str, Enum):
|
|
68
|
+
model = "model"
|
|
69
|
+
dataset = "dataset"
|
|
70
|
+
space = "space"
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
RepoIdArg = Annotated[
|
|
74
|
+
str,
|
|
75
|
+
typer.Argument(
|
|
76
|
+
help="The ID of the repo (e.g. `username/repo-name`).",
|
|
77
|
+
),
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
RepoTypeOpt = Annotated[
|
|
82
|
+
RepoType,
|
|
83
|
+
typer.Option(
|
|
84
|
+
help="The type of repository (model, dataset, or space).",
|
|
85
|
+
),
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
TokenOpt = Annotated[
|
|
89
|
+
Optional[str],
|
|
90
|
+
typer.Option(
|
|
91
|
+
help="A User Access Token generated from https://huggingface.co/settings/tokens.",
|
|
92
|
+
),
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
PrivateOpt = Annotated[
|
|
96
|
+
bool,
|
|
97
|
+
typer.Option(
|
|
98
|
+
help="Whether to create a private repo if repo doesn't exist on the Hub. Ignored if the repo already exists.",
|
|
99
|
+
),
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
RevisionOpt = Annotated[
|
|
103
|
+
Optional[str],
|
|
104
|
+
typer.Option(
|
|
105
|
+
help="Git revision id which can be a branch name, a tag, or a commit hash.",
|
|
106
|
+
),
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### PyPI VERSION CHECKER
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def check_cli_update() -> None:
|
|
114
|
+
"""
|
|
115
|
+
Check whether a newer version of `huggingface_hub` is available on PyPI.
|
|
116
|
+
|
|
117
|
+
If a newer version is found, notify the user and suggest updating.
|
|
118
|
+
If current version is a pre-release (e.g. `1.0.0.rc1`), or a dev version (e.g. `1.0.0.dev1`), no check is performed.
|
|
119
|
+
|
|
120
|
+
This function is called at the entry point of the CLI. It only performs the check once every 24 hours, and any error
|
|
121
|
+
during the check is caught and logged, to avoid breaking the CLI.
|
|
122
|
+
"""
|
|
123
|
+
try:
|
|
124
|
+
_check_cli_update()
|
|
125
|
+
except Exception:
|
|
126
|
+
# We don't want the CLI to fail on version checks, no matter the reason.
|
|
127
|
+
logger.debug("Error while checking for CLI update.", exc_info=True)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _check_cli_update() -> None:
|
|
131
|
+
current_version = importlib.metadata.version("huggingface_hub")
|
|
132
|
+
|
|
133
|
+
# Skip if current version is a pre-release or dev version
|
|
134
|
+
if any(tag in current_version for tag in ["rc", "dev"]):
|
|
135
|
+
return
|
|
136
|
+
|
|
137
|
+
# Skip if already checked in the last 24 hours
|
|
138
|
+
if os.path.exists(constants.CHECK_FOR_UPDATE_DONE_PATH):
|
|
139
|
+
mtime = os.path.getmtime(constants.CHECK_FOR_UPDATE_DONE_PATH)
|
|
140
|
+
if (time.time() - mtime) < 24 * 3600:
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
# Touch the file to mark that we did the check now
|
|
144
|
+
Path(constants.CHECK_FOR_UPDATE_DONE_PATH).touch()
|
|
145
|
+
|
|
146
|
+
# Check latest version from PyPI
|
|
147
|
+
response = get_session().get("https://pypi.org/pypi/huggingface_hub/json", timeout=2)
|
|
148
|
+
hf_raise_for_status(response)
|
|
149
|
+
data = response.json()
|
|
150
|
+
latest_version = data["info"]["version"]
|
|
151
|
+
|
|
152
|
+
# If latest version is different from current, notify user
|
|
153
|
+
if current_version != latest_version:
|
|
154
|
+
method = installation_method()
|
|
155
|
+
if method == "brew":
|
|
156
|
+
update_command = "brew upgrade huggingface-cli"
|
|
157
|
+
elif method == "hf_installer" and os.name == "nt":
|
|
158
|
+
update_command = 'powershell -NoProfile -Command "iwr -useb https://hf.co/cli/install.ps1 | iex"'
|
|
159
|
+
elif method == "hf_installer":
|
|
160
|
+
update_command = "curl -LsSf https://hf.co/cli/install.sh | sh -"
|
|
161
|
+
else: # unknown => likely pip
|
|
162
|
+
update_command = "pip install -U huggingface_hub"
|
|
163
|
+
|
|
164
|
+
click.echo(
|
|
165
|
+
ANSI.yellow(
|
|
166
|
+
f"A new version of huggingface_hub ({latest_version}) is available! "
|
|
167
|
+
f"You are using version {current_version}.\n"
|
|
168
|
+
f"To update, run: {ANSI.bold(update_command)}\n",
|
|
169
|
+
)
|
|
170
|
+
)
|
|
@@ -39,8 +39,8 @@ from huggingface_hub.errors import HfHubHTTPError
|
|
|
39
39
|
from huggingface_hub.hf_api import whoami
|
|
40
40
|
|
|
41
41
|
from .._login import auth_list, auth_switch, login, logout
|
|
42
|
-
from ..utils import get_stored_tokens, get_token, logging
|
|
43
|
-
from ._cli_utils import
|
|
42
|
+
from ..utils import ANSI, get_stored_tokens, get_token, logging
|
|
43
|
+
from ._cli_utils import TokenOpt, typer_factory
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
logger = logging.get_logger(__name__)
|
|
@@ -23,8 +23,8 @@ from typing import Annotated, Any, Callable, Iterable, Optional, Union
|
|
|
23
23
|
|
|
24
24
|
import typer
|
|
25
25
|
|
|
26
|
-
from ..utils import CachedRepoInfo, CachedRevisionInfo, CacheNotFound, HFCacheInfo, scan_cache_dir
|
|
27
|
-
from ._cli_utils import
|
|
26
|
+
from ..utils import ANSI, CachedRepoInfo, CachedRevisionInfo, CacheNotFound, HFCacheInfo, scan_cache_dir, tabulate
|
|
27
|
+
from ._cli_utils import typer_factory
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
# --- DELETE helpers (from delete_cache.py) ---
|
|
@@ -44,9 +44,9 @@ import typer
|
|
|
44
44
|
from huggingface_hub import logging
|
|
45
45
|
from huggingface_hub._snapshot_download import snapshot_download
|
|
46
46
|
from huggingface_hub.file_download import DryRunFileInfo, hf_hub_download
|
|
47
|
-
from huggingface_hub.utils import _format_size, disable_progress_bars, enable_progress_bars
|
|
47
|
+
from huggingface_hub.utils import _format_size, disable_progress_bars, enable_progress_bars, tabulate
|
|
48
48
|
|
|
49
|
-
from ._cli_utils import RepoIdArg, RepoTypeOpt, RevisionOpt, TokenOpt
|
|
49
|
+
from ._cli_utils import RepoIdArg, RepoTypeOpt, RevisionOpt, TokenOpt
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
logger = logging.get_logger(__name__)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
from huggingface_hub.cli._cli_utils import typer_factory
|
|
16
|
+
from huggingface_hub.cli._cli_utils import check_cli_update, typer_factory
|
|
17
17
|
from huggingface_hub.cli.auth import auth_cli
|
|
18
18
|
from huggingface_hub.cli.cache import cache_cli
|
|
19
19
|
from huggingface_hub.cli.download import download
|
|
@@ -52,6 +52,7 @@ app.add_typer(jobs_cli, name="jobs")
|
|
|
52
52
|
|
|
53
53
|
def main():
|
|
54
54
|
logging.set_verbosity_info()
|
|
55
|
+
check_cli_update()
|
|
55
56
|
app()
|
|
56
57
|
|
|
57
58
|
|
|
@@ -27,10 +27,9 @@ from typing import Annotated, Optional
|
|
|
27
27
|
import typer
|
|
28
28
|
|
|
29
29
|
from huggingface_hub.errors import HfHubHTTPError, RepositoryNotFoundError, RevisionNotFoundError
|
|
30
|
-
from huggingface_hub.utils import logging
|
|
30
|
+
from huggingface_hub.utils import ANSI, logging
|
|
31
31
|
|
|
32
32
|
from ._cli_utils import (
|
|
33
|
-
ANSI,
|
|
34
33
|
PrivateOpt,
|
|
35
34
|
RepoIdArg,
|
|
36
35
|
RepoType,
|
{huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/cli/upload_large_folder.py
RENAMED
|
@@ -20,9 +20,9 @@ from typing import Annotated, Optional
|
|
|
20
20
|
import typer
|
|
21
21
|
|
|
22
22
|
from huggingface_hub import logging
|
|
23
|
-
from huggingface_hub.utils import disable_progress_bars
|
|
23
|
+
from huggingface_hub.utils import ANSI, disable_progress_bars
|
|
24
24
|
|
|
25
|
-
from ._cli_utils import
|
|
25
|
+
from ._cli_utils import PrivateOpt, RepoIdArg, RepoType, RepoTypeOpt, RevisionOpt, TokenOpt, get_hf_api
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
logger = logging.get_logger(__name__)
|
|
@@ -163,6 +163,10 @@ HF_ASSETS_CACHE = os.path.expandvars(
|
|
|
163
163
|
|
|
164
164
|
HF_HUB_OFFLINE = _is_true(os.environ.get("HF_HUB_OFFLINE") or os.environ.get("TRANSFORMERS_OFFLINE"))
|
|
165
165
|
|
|
166
|
+
# File created to mark that the version check has been done.
|
|
167
|
+
# Check is performed once per 24 hours at most.
|
|
168
|
+
CHECK_FOR_UPDATE_DONE_PATH = os.path.join(HF_HOME, ".check_for_update_done")
|
|
169
|
+
|
|
166
170
|
# If set, log level will be set to DEBUG and all requests made to the Hub will be logged
|
|
167
171
|
# as curl commands for reproducibility.
|
|
168
172
|
HF_DEBUG = _is_true(os.environ.get("HF_DEBUG"))
|
|
@@ -431,11 +431,11 @@ def type_validator(name: str, value: Any, expected_type: Any) -> None:
|
|
|
431
431
|
elif origin is Required:
|
|
432
432
|
if value is _TYPED_DICT_DEFAULT_VALUE:
|
|
433
433
|
raise TypeError(f"Field '{name}' is required but missing.")
|
|
434
|
-
|
|
434
|
+
type_validator(name, value, args[0])
|
|
435
435
|
elif origin is NotRequired:
|
|
436
436
|
if value is _TYPED_DICT_DEFAULT_VALUE:
|
|
437
437
|
return
|
|
438
|
-
|
|
438
|
+
type_validator(name, value, args[0])
|
|
439
439
|
else:
|
|
440
440
|
raise TypeError(f"Unsupported type for field '{name}': {expected_type}")
|
|
441
441
|
|
|
@@ -85,6 +85,7 @@ from ._runtime import (
|
|
|
85
85
|
get_tensorboard_version,
|
|
86
86
|
get_tf_version,
|
|
87
87
|
get_torch_version,
|
|
88
|
+
installation_method,
|
|
88
89
|
is_aiohttp_available,
|
|
89
90
|
is_colab_enterprise,
|
|
90
91
|
is_fastai_available,
|
|
@@ -109,6 +110,7 @@ from ._runtime import (
|
|
|
109
110
|
from ._safetensors import SafetensorsFileMetadata, SafetensorsRepoMetadata, TensorInfo
|
|
110
111
|
from ._subprocess import capture_output, run_interactive_subprocess, run_subprocess
|
|
111
112
|
from ._telemetry import send_telemetry
|
|
113
|
+
from ._terminal import ANSI, tabulate
|
|
112
114
|
from ._typing import is_jsonable, is_simple_optional_type, unwrap_simple_optional_type
|
|
113
115
|
from ._validators import validate_hf_hub_args, validate_repo_id
|
|
114
116
|
from ._xet import (
|
{huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/utils/_cache_manager.py
RENAMED
|
@@ -24,9 +24,9 @@ from typing import Literal, Optional, Union
|
|
|
24
24
|
|
|
25
25
|
from huggingface_hub.errors import CacheNotFound, CorruptedCacheException
|
|
26
26
|
|
|
27
|
-
from ..cli._cli_utils import tabulate
|
|
28
27
|
from ..constants import HF_HUB_CACHE
|
|
29
28
|
from . import logging
|
|
29
|
+
from ._terminal import tabulate
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
logger = logging.get_logger(__name__)
|
|
@@ -716,9 +716,9 @@ def _curlify(request: httpx.Request) -> str:
|
|
|
716
716
|
flat_parts = []
|
|
717
717
|
for k, v in parts:
|
|
718
718
|
if k:
|
|
719
|
-
flat_parts.append(quote(k))
|
|
719
|
+
flat_parts.append(quote(str(k)))
|
|
720
720
|
if v:
|
|
721
|
-
flat_parts.append(quote(v))
|
|
721
|
+
flat_parts.append(quote(str(v)))
|
|
722
722
|
|
|
723
723
|
return " ".join(flat_parts)
|
|
724
724
|
|
|
@@ -19,7 +19,8 @@ import os
|
|
|
19
19
|
import platform
|
|
20
20
|
import sys
|
|
21
21
|
import warnings
|
|
22
|
-
from
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from typing import Any, Literal
|
|
23
24
|
|
|
24
25
|
from .. import __version__, constants
|
|
25
26
|
|
|
@@ -322,6 +323,49 @@ def is_colab_enterprise() -> bool:
|
|
|
322
323
|
return os.environ.get("VERTEX_PRODUCT") == "COLAB_ENTERPRISE"
|
|
323
324
|
|
|
324
325
|
|
|
326
|
+
# Check how huggingface_hub has been installed
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def installation_method() -> Literal["brew", "hf_installer", "unknown"]:
|
|
330
|
+
"""Return the installation method of the current environment.
|
|
331
|
+
|
|
332
|
+
- "hf_installer" if installed via the official installer script
|
|
333
|
+
- "brew" if installed via Homebrew
|
|
334
|
+
- "unknown" otherwise
|
|
335
|
+
"""
|
|
336
|
+
if _is_brew_installation():
|
|
337
|
+
return "brew"
|
|
338
|
+
elif _is_hf_installer_installation():
|
|
339
|
+
return "hf_installer"
|
|
340
|
+
else:
|
|
341
|
+
return "unknown"
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def _is_brew_installation() -> bool:
|
|
345
|
+
"""Check if running from a Homebrew installation.
|
|
346
|
+
|
|
347
|
+
Note: AI-generated by Claude.
|
|
348
|
+
"""
|
|
349
|
+
exe_path = Path(sys.executable).resolve()
|
|
350
|
+
exe_str = str(exe_path)
|
|
351
|
+
|
|
352
|
+
# Check common Homebrew paths
|
|
353
|
+
# /opt/homebrew (Apple Silicon), /usr/local (Intel)
|
|
354
|
+
return "/Cellar/" in exe_str or "/opt/homebrew/" in exe_str or exe_str.startswith("/usr/local/Cellar/")
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def _is_hf_installer_installation() -> bool:
|
|
358
|
+
"""Return `True` if the current environment was set up via the official hf installer script.
|
|
359
|
+
|
|
360
|
+
i.e. using one of
|
|
361
|
+
curl -LsSf https://hf.co/cli/install.sh | sh
|
|
362
|
+
powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
|
|
363
|
+
"""
|
|
364
|
+
venv = sys.prefix # points to venv root if active
|
|
365
|
+
marker = Path(venv) / ".hf_installer_marker"
|
|
366
|
+
return marker.exists()
|
|
367
|
+
|
|
368
|
+
|
|
325
369
|
def dump_environment_info() -> dict[str, Any]:
|
|
326
370
|
"""Dump information about the machine to help debugging issues.
|
|
327
371
|
|
|
@@ -366,6 +410,9 @@ def dump_environment_info() -> dict[str, Any]:
|
|
|
366
410
|
except Exception:
|
|
367
411
|
pass
|
|
368
412
|
|
|
413
|
+
# How huggingface_hub has been installed?
|
|
414
|
+
info["Installation method"] = installation_method()
|
|
415
|
+
|
|
369
416
|
# Installed dependencies
|
|
370
417
|
info["Torch"] = get_torch_version()
|
|
371
418
|
info["httpx"] = get_httpx_version()
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Copyright 2025 The HuggingFace Team. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Contains utilities to print stuff to the terminal (styling, helpers)."""
|
|
15
|
+
|
|
16
|
+
import os
|
|
17
|
+
from typing import Union
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ANSI:
|
|
21
|
+
"""
|
|
22
|
+
Helper for en.wikipedia.org/wiki/ANSI_escape_code
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
_bold = "\u001b[1m"
|
|
26
|
+
_gray = "\u001b[90m"
|
|
27
|
+
_red = "\u001b[31m"
|
|
28
|
+
_reset = "\u001b[0m"
|
|
29
|
+
_yellow = "\u001b[33m"
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def bold(cls, s: str) -> str:
|
|
33
|
+
return cls._format(s, cls._bold)
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def gray(cls, s: str) -> str:
|
|
37
|
+
return cls._format(s, cls._gray)
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def red(cls, s: str) -> str:
|
|
41
|
+
return cls._format(s, cls._bold + cls._red)
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def yellow(cls, s: str) -> str:
|
|
45
|
+
return cls._format(s, cls._yellow)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def _format(cls, s: str, code: str) -> str:
|
|
49
|
+
if os.environ.get("NO_COLOR"):
|
|
50
|
+
# See https://no-color.org/
|
|
51
|
+
return s
|
|
52
|
+
return f"{code}{s}{cls._reset}"
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def tabulate(rows: list[list[Union[str, int]]], headers: list[str]) -> str:
|
|
56
|
+
"""
|
|
57
|
+
Inspired by:
|
|
58
|
+
|
|
59
|
+
- stackoverflow.com/a/8356620/593036
|
|
60
|
+
- stackoverflow.com/questions/9535954/printing-lists-as-tabular-data
|
|
61
|
+
"""
|
|
62
|
+
col_widths = [max(len(str(x)) for x in col) for col in zip(*rows, headers)]
|
|
63
|
+
row_format = ("{{:{}}} " * len(headers)).format(*col_widths)
|
|
64
|
+
lines = []
|
|
65
|
+
lines.append(row_format.format(*headers))
|
|
66
|
+
lines.append(row_format.format(*["-" * w for w in col_widths]))
|
|
67
|
+
for row in rows:
|
|
68
|
+
lines.append(row_format.format(*row))
|
|
69
|
+
return "\n".join(lines)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface-hub
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0rc4
|
|
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.
|
{huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub.egg-info/SOURCES.txt
RENAMED
|
@@ -143,6 +143,7 @@ src/huggingface_hub/utils/_runtime.py
|
|
|
143
143
|
src/huggingface_hub/utils/_safetensors.py
|
|
144
144
|
src/huggingface_hub/utils/_subprocess.py
|
|
145
145
|
src/huggingface_hub/utils/_telemetry.py
|
|
146
|
+
src/huggingface_hub/utils/_terminal.py
|
|
146
147
|
src/huggingface_hub/utils/_typing.py
|
|
147
148
|
src/huggingface_hub/utils/_validators.py
|
|
148
149
|
src/huggingface_hub/utils/_xet.py
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
"""Contains CLI utilities (styling, helpers)."""
|
|
15
|
-
|
|
16
|
-
import os
|
|
17
|
-
from enum import Enum
|
|
18
|
-
from typing import TYPE_CHECKING, Annotated, Optional, Union
|
|
19
|
-
|
|
20
|
-
import click
|
|
21
|
-
import typer
|
|
22
|
-
|
|
23
|
-
from huggingface_hub import __version__
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if TYPE_CHECKING:
|
|
27
|
-
from huggingface_hub.hf_api import HfApi
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def get_hf_api(token: Optional[str] = None) -> "HfApi":
|
|
31
|
-
# Import here to avoid circular import
|
|
32
|
-
from huggingface_hub.hf_api import HfApi
|
|
33
|
-
|
|
34
|
-
return HfApi(token=token, library_name="hf", library_version=__version__)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ANSI:
|
|
38
|
-
"""
|
|
39
|
-
Helper for en.wikipedia.org/wiki/ANSI_escape_code
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
_bold = "\u001b[1m"
|
|
43
|
-
_gray = "\u001b[90m"
|
|
44
|
-
_red = "\u001b[31m"
|
|
45
|
-
_reset = "\u001b[0m"
|
|
46
|
-
_yellow = "\u001b[33m"
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def bold(cls, s: str) -> str:
|
|
50
|
-
return cls._format(s, cls._bold)
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def gray(cls, s: str) -> str:
|
|
54
|
-
return cls._format(s, cls._gray)
|
|
55
|
-
|
|
56
|
-
@classmethod
|
|
57
|
-
def red(cls, s: str) -> str:
|
|
58
|
-
return cls._format(s, cls._bold + cls._red)
|
|
59
|
-
|
|
60
|
-
@classmethod
|
|
61
|
-
def yellow(cls, s: str) -> str:
|
|
62
|
-
return cls._format(s, cls._yellow)
|
|
63
|
-
|
|
64
|
-
@classmethod
|
|
65
|
-
def _format(cls, s: str, code: str) -> str:
|
|
66
|
-
if os.environ.get("NO_COLOR"):
|
|
67
|
-
# See https://no-color.org/
|
|
68
|
-
return s
|
|
69
|
-
return f"{code}{s}{cls._reset}"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def tabulate(rows: list[list[Union[str, int]]], headers: list[str]) -> str:
|
|
73
|
-
"""
|
|
74
|
-
Inspired by:
|
|
75
|
-
|
|
76
|
-
- stackoverflow.com/a/8356620/593036
|
|
77
|
-
- stackoverflow.com/questions/9535954/printing-lists-as-tabular-data
|
|
78
|
-
"""
|
|
79
|
-
col_widths = [max(len(str(x)) for x in col) for col in zip(*rows, headers)]
|
|
80
|
-
row_format = ("{{:{}}} " * len(headers)).format(*col_widths)
|
|
81
|
-
lines = []
|
|
82
|
-
lines.append(row_format.format(*headers))
|
|
83
|
-
lines.append(row_format.format(*["-" * w for w in col_widths]))
|
|
84
|
-
for row in rows:
|
|
85
|
-
lines.append(row_format.format(*row))
|
|
86
|
-
return "\n".join(lines)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
#### TYPER UTILS
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class AlphabeticalMixedGroup(typer.core.TyperGroup):
|
|
93
|
-
"""
|
|
94
|
-
Typer Group that lists commands and sub-apps mixed and alphabetically.
|
|
95
|
-
"""
|
|
96
|
-
|
|
97
|
-
def list_commands(self, ctx: click.Context) -> list[str]: # type: ignore[name-defined]
|
|
98
|
-
# click.Group stores both commands and sub-groups in `self.commands`
|
|
99
|
-
return sorted(self.commands.keys())
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def typer_factory(help: str) -> typer.Typer:
|
|
103
|
-
return typer.Typer(
|
|
104
|
-
help=help,
|
|
105
|
-
add_completion=True,
|
|
106
|
-
rich_markup_mode=None,
|
|
107
|
-
no_args_is_help=True,
|
|
108
|
-
cls=AlphabeticalMixedGroup,
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
class RepoType(str, Enum):
|
|
113
|
-
model = "model"
|
|
114
|
-
dataset = "dataset"
|
|
115
|
-
space = "space"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
RepoIdArg = Annotated[
|
|
119
|
-
str,
|
|
120
|
-
typer.Argument(
|
|
121
|
-
help="The ID of the repo (e.g. `username/repo-name`).",
|
|
122
|
-
),
|
|
123
|
-
]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
RepoTypeOpt = Annotated[
|
|
127
|
-
RepoType,
|
|
128
|
-
typer.Option(
|
|
129
|
-
help="The type of repository (model, dataset, or space).",
|
|
130
|
-
),
|
|
131
|
-
]
|
|
132
|
-
|
|
133
|
-
TokenOpt = Annotated[
|
|
134
|
-
Optional[str],
|
|
135
|
-
typer.Option(
|
|
136
|
-
help="A User Access Token generated from https://huggingface.co/settings/tokens.",
|
|
137
|
-
),
|
|
138
|
-
]
|
|
139
|
-
|
|
140
|
-
PrivateOpt = Annotated[
|
|
141
|
-
bool,
|
|
142
|
-
typer.Option(
|
|
143
|
-
help="Whether to create a private repo if repo doesn't exist on the Hub. Ignored if the repo already exists.",
|
|
144
|
-
),
|
|
145
|
-
]
|
|
146
|
-
|
|
147
|
-
RevisionOpt = Annotated[
|
|
148
|
-
Optional[str],
|
|
149
|
-
typer.Option(
|
|
150
|
-
help="Git revision id which can be a branch name, a tag, or a commit hash.",
|
|
151
|
-
),
|
|
152
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-1.0.0rc3 → huggingface_hub-1.0.0rc4}/src/huggingface_hub/_commit_scheduler.py
RENAMED
|
File without changes
|