├── .git-blame-ignore-revs ├── .github ├── ISSUE_TEMPLATE │ ├── bugs.md │ ├── documentation-request.md │ └── feature_request.md └── workflows │ ├── api_inference_build_documentation.yml │ ├── api_inference_build_pr_documentation.yml │ ├── api_inference_upload_pr_documentation.yml │ ├── build_documentation.yml │ ├── build_pr_documentation.yml │ ├── delete_doc_comment.yml │ ├── delete_doc_comment_trigger.yml │ ├── generate_inference_providers_documentation.yml │ ├── model_card_consistency_reminder.yml │ ├── sagemaker_build_documentation.yml │ ├── sagemaker_build_pr_documentation.yml │ ├── sagemaker_delete_doc_comment.yml │ ├── sagemaker_upload_pr_documentation.yml │ ├── trufflehog.yml │ └── upload_pr_documentation.yml ├── .gitignore ├── LICENSE ├── README.md ├── datasetcard.md ├── docs ├── hub │ ├── _config.py │ ├── _redirects.yml │ ├── _toctree.yml │ ├── academia-hub.md │ ├── adapters.md │ ├── advanced-compute-options.md │ ├── agents.md │ ├── allennlp.md │ ├── api.md │ ├── asteroid.md │ ├── audit-logs.md │ ├── bertopic.md │ ├── billing.md │ ├── collections.md │ ├── datasets-adding.md │ ├── datasets-argilla.md │ ├── datasets-audio.md │ ├── datasets-cards.md │ ├── datasets-dask.md │ ├── datasets-data-files-configuration.md │ ├── datasets-distilabel.md │ ├── datasets-download-stats.md │ ├── datasets-downloading.md │ ├── datasets-duckdb-auth.md │ ├── datasets-duckdb-combine-and-export.md │ ├── datasets-duckdb-select.md │ ├── datasets-duckdb-sql.md │ ├── datasets-duckdb-vector-similarity-search.md │ ├── datasets-duckdb.md │ ├── datasets-fiftyone.md │ ├── datasets-file-names-and-splits.md │ ├── datasets-gated.md │ ├── datasets-image.md │ ├── datasets-libraries.md │ ├── datasets-manual-configuration.md │ ├── datasets-overview.md │ ├── datasets-pandas.md │ ├── datasets-polars-auth.md │ ├── datasets-polars-file-formats.md │ ├── datasets-polars-operations.md │ ├── datasets-polars-optimizations.md │ ├── datasets-polars.md │ ├── datasets-spark.md │ ├── datasets-usage.md │ ├── datasets-video.md │ ├── datasets-viewer-configure.md │ ├── datasets-viewer-embed.md │ ├── datasets-viewer-sql-console.md │ ├── datasets-viewer.md │ ├── datasets-webdataset.md │ ├── datasets.md │ ├── dduf.md │ ├── diffusers.md │ ├── doi.md │ ├── enterprise-hub-advanced-security.md │ ├── enterprise-hub-advanced-sso.md │ ├── enterprise-hub-analytics.md │ ├── enterprise-hub-datasets.md │ ├── enterprise-hub-gating-group-collections.md │ ├── enterprise-hub-network-security.md │ ├── enterprise-hub-resource-groups.md │ ├── enterprise-hub-tokens-management.md │ ├── enterprise-hub.md │ ├── enterprise-sso.md │ ├── espnet.md │ ├── fastai.md │ ├── flair.md │ ├── gguf-gpt4all.md │ ├── gguf-llamacpp.md │ ├── gguf.md │ ├── index.md │ ├── keras.md │ ├── ml-agents.md │ ├── mlx-image.md │ ├── mlx.md │ ├── model-card-annotated.md │ ├── model-card-appendix.md │ ├── model-card-guidebook.md │ ├── model-card-landscape-analysis.md │ ├── model-cards-co2.md │ ├── model-cards-components.md │ ├── model-cards-user-studies.md │ ├── model-cards.md │ ├── model-release-checklist.md │ ├── models-adding-libraries.md │ ├── models-advanced.md │ ├── models-download-stats.md │ ├── models-downloading.md │ ├── models-faq.md │ ├── models-gated.md │ ├── models-inference.md │ ├── models-libraries.md │ ├── models-tasks.md │ ├── models-the-hub.md │ ├── models-uploading.md │ ├── models-widgets-examples.md │ ├── models-widgets.md │ ├── models.md │ ├── moderation.md │ ├── notebooks.md │ ├── notifications.md │ ├── oauth.md │ ├── ollama.md │ ├── open_clip.md │ ├── organizations-cards.md │ ├── organizations-managing.md │ ├── organizations-security.md │ ├── organizations.md │ ├── other.md │ ├── paddlenlp.md │ ├── paper-pages.md │ ├── peft.md │ ├── repositories-getting-started.md │ ├── repositories-licenses.md │ ├── repositories-next-steps.md │ ├── repositories-pull-requests-discussions.md │ ├── repositories-settings.md │ ├── repositories.md │ ├── rl-baselines3-zoo.md │ ├── sample-factory.md │ ├── search.md │ ├── security-2fa.md │ ├── security-git-ssh.md │ ├── security-gpg.md │ ├── security-jfrog.md │ ├── security-malware.md │ ├── security-pickle.md │ ├── security-protectai.md │ ├── security-resource-groups.md │ ├── security-secrets.md │ ├── security-sso-azure-oidc.md │ ├── security-sso-azure-saml.md │ ├── security-sso-okta-oidc.md │ ├── security-sso-okta-saml.md │ ├── security-sso.md │ ├── security-tokens.md │ ├── security.md │ ├── sentence-transformers.md │ ├── setfit.md │ ├── spaces-add-to-arxiv.md │ ├── spaces-advanced.md │ ├── spaces-changelog.md │ ├── spaces-circleci.md │ ├── spaces-config-reference.md │ ├── spaces-cookie-limitations.md │ ├── spaces-dependencies.md │ ├── spaces-dev-mode.md │ ├── spaces-embed.md │ ├── spaces-github-actions.md │ ├── spaces-gpus.md │ ├── spaces-handle-url-parameters.md │ ├── spaces-more-ways-to-create.md │ ├── spaces-oauth.md │ ├── spaces-organization-cards.md │ ├── spaces-overview.md │ ├── spaces-run-with-docker.md │ ├── spaces-sdks-docker-aim.md │ ├── spaces-sdks-docker-argilla.md │ ├── spaces-sdks-docker-chatui.md │ ├── spaces-sdks-docker-evidence.md │ ├── spaces-sdks-docker-examples.md │ ├── spaces-sdks-docker-first-demo.md │ ├── spaces-sdks-docker-giskard.md │ ├── spaces-sdks-docker-jupyter.md │ ├── spaces-sdks-docker-label-studio.md │ ├── spaces-sdks-docker-langfuse.md │ ├── spaces-sdks-docker-livebook.md │ ├── spaces-sdks-docker-marimo.md │ ├── spaces-sdks-docker-panel.md │ ├── spaces-sdks-docker-shiny.md │ ├── spaces-sdks-docker-tabby.md │ ├── spaces-sdks-docker-zenml.md │ ├── spaces-sdks-docker.md │ ├── spaces-sdks-gradio.md │ ├── spaces-sdks-python.md │ ├── spaces-sdks-static.md │ ├── spaces-sdks-streamlit.md │ ├── spaces-settings.md │ ├── spaces-storage.md │ ├── spaces-using-opencv.md │ ├── spaces-zerogpu.md │ ├── spaces.md │ ├── spacy.md │ ├── span_marker.md │ ├── speechbrain.md │ ├── stable-baselines3.md │ ├── stanza.md │ ├── storage-backends.md │ ├── storage-limits.md │ ├── storage-regions.md │ ├── tensorboard.md │ ├── tf-keras.md │ ├── timm.md │ ├── transformers-js.md │ ├── transformers.md │ ├── unity-sentis.md │ ├── webhooks-guide-auto-retrain.md │ ├── webhooks-guide-discussion-bot.md │ ├── webhooks-guide-metadata-review.md │ └── webhooks.md ├── inference-providers │ ├── _redirects.yml │ ├── _toctree.yml │ ├── hub-api.md │ ├── hub-integration.md │ ├── index.md │ ├── pricing.md │ ├── providers │ │ ├── cerebras.md │ │ ├── cohere.md │ │ ├── fal-ai.md │ │ ├── fireworks-ai.md │ │ ├── hf-inference.md │ │ ├── hyperbolic.md │ │ ├── nebius.md │ │ ├── novita.md │ │ ├── nscale.md │ │ ├── replicate.md │ │ ├── sambanova.md │ │ └── together.md │ ├── register-as-a-provider.md │ ├── security.md │ └── tasks │ │ ├── audio-classification.md │ │ ├── automatic-speech-recognition.md │ │ ├── chat-completion.md │ │ ├── feature-extraction.md │ │ ├── fill-mask.md │ │ ├── image-classification.md │ │ ├── image-segmentation.md │ │ ├── image-to-image.md │ │ ├── index.md │ │ ├── object-detection.md │ │ ├── question-answering.md │ │ ├── summarization.md │ │ ├── table-question-answering.md │ │ ├── text-classification.md │ │ ├── text-generation.md │ │ ├── text-to-image.md │ │ ├── text-to-video.md │ │ ├── token-classification.md │ │ ├── translation.md │ │ └── zero-shot-classification.md └── sagemaker │ ├── Makefile │ ├── notebooks │ └── sagemaker-sdk │ │ ├── deploy-embedding-models │ │ ├── assets │ │ │ └── cw.png │ │ └── sagemaker-notebook.ipynb │ │ ├── deploy-llama-3-3-70b-inferentia2 │ │ └── sagemaker-notebook.ipynb │ │ ├── evaluate-llm-lighteval │ │ └── sagemaker-notebook.ipynb │ │ └── fine-tune-embedding-models │ │ ├── assets │ │ ├── requirements.txt │ │ └── run_mnr.py │ │ └── sagemaker-notebook.ipynb │ ├── scripts │ ├── auto-generate-examples.py │ └── auto-update-toctree.py │ └── source │ ├── .gitignore │ ├── _toctree.yml │ ├── dlcs │ ├── available.md │ └── introduction.md │ ├── index.md │ ├── reference │ ├── inference-toolkit.md │ └── resources.md │ └── tutorials │ ├── bedrock │ └── bedrock-quickstart.md │ ├── compute-services │ └── compute-services-quickstart.md │ ├── index.md │ ├── jumpstart │ └── jumpstart-quickstart.md │ └── sagemaker-sdk │ ├── deploy-sagemaker-sdk.md │ ├── sagemaker-sdk-quickstart.md │ └── training-sagemaker-sdk.md ├── hacktoberfest_challenges ├── datasets_without_language.csv ├── datasets_without_language.md ├── model_license_other.csv ├── model_license_other.md ├── model_no_license.csv └── model_no_license.md ├── modelcard.md └── scripts └── inference-providers ├── .gitignore ├── .prettierignore ├── README.md ├── package.json ├── pnpm-lock.yaml ├── scripts ├── .gitignore └── generate.ts ├── templates ├── common │ ├── follow-us-button.handlebars │ ├── page-header.handlebars │ ├── provider-header.handlebars │ ├── provider-logo.handlebars │ ├── provider-tasks.handlebars │ ├── snippets-template.handlebars │ ├── specs-headers.handlebars │ ├── specs-output.handlebars │ └── specs-payload.handlebars ├── providers │ ├── cerebras.handlebars │ ├── cohere.handlebars │ ├── fal-ai.handlebars │ ├── fireworks-ai.handlebars │ ├── hf-inference.handlebars │ ├── hyperbolic.handlebars │ ├── nebius.handlebars │ ├── novita.handlebars │ ├── nscale.handlebars │ ├── replicate.handlebars │ ├── sambanova.handlebars │ └── together.handlebars └── task │ ├── audio-classification.handlebars │ ├── automatic-speech-recognition.handlebars │ ├── chat-completion.handlebars │ ├── feature-extraction.handlebars │ ├── fill-mask.handlebars │ ├── image-classification.handlebars │ ├── image-segmentation.handlebars │ ├── image-to-image.handlebars │ ├── object-detection.handlebars │ ├── question-answering.handlebars │ ├── summarization.handlebars │ ├── table-question-answering.handlebars │ ├── text-classification.handlebars │ ├── text-generation.handlebars │ ├── text-to-image.handlebars │ ├── text-to-video.handlebars │ ├── token-classification.handlebars │ ├── translation.handlebars │ └── zero-shot-classification.handlebars └── tsconfig.json /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Format & lint all files see https://github.com/huggingface/hub-docs/pull/924 and https://github.com/huggingface/hub-docs/pull/936 2 | b1a591d6174852341bfd69e9e0be4168c53b2ebb 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bugs.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Report a bug you face in the Hub 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **This repository is focused on the Hub experience and documentation. If you're facing an issue with a specific library, please open an issue in the corresponding GitHub repo. If you're facing an issue with a specific model or dataset, please open an issue in the corresponding HF repo.** 11 | 12 | 13 | **Bug description.** 14 | A clear and concise description of what the problem is. Ex. Clicking this button is not working when [...] 15 | 16 | **Describe the expected behaviour** 17 | A clear and concise description of what you want to happen. 18 | 19 | **Additional context** 20 | Add any other relevant context or screenshots here. Please share details such as browser when appropriate. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation request 3 | about: Suggest an idea for new docs 4 | title: '' 5 | labels: 'docs' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Doc request** 11 | A clear and concise description of what you would like to see documented or what is unclear. 12 | 13 | **Additional context** 14 | Add any other context or screenshots about the feature request here. 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/api_inference_build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build Inference Providers documentation 2 | 3 | on: 4 | push: 5 | paths: 6 | - "docs/inference-providers/**" 7 | branches: 8 | - main 9 | 10 | jobs: 11 | build: 12 | uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main 13 | with: 14 | commit_sha: ${{ github.sha }} 15 | package: hub-docs 16 | package_name: inference-providers 17 | path_to_docs: hub-docs/docs/inference-providers/ 18 | additional_args: --not_python_module 19 | secrets: 20 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 21 | -------------------------------------------------------------------------------- /.github/workflows/api_inference_build_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build Inference Providers PR Documentation 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - "docs/inference-providers/**" 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | build: 14 | uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main 15 | with: 16 | commit_sha: ${{ github.event.pull_request.head.sha }} 17 | pr_number: ${{ github.event.number }} 18 | package: hub-docs 19 | package_name: inference-providers 20 | path_to_docs: hub-docs/docs/inference-providers/ 21 | additional_args: --not_python_module 22 | -------------------------------------------------------------------------------- /.github/workflows/api_inference_upload_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Upload Inference Providers PR Documentation 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["Build Inference Providers PR Documentation"] 6 | types: 7 | - completed 8 | 9 | jobs: 10 | build: 11 | uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main 12 | with: 13 | package_name: inference-providers 14 | secrets: 15 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 16 | comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build documentation 2 | 3 | on: 4 | push: 5 | paths: 6 | - "docs/hub/**" 7 | branches: 8 | - main 9 | 10 | jobs: 11 | build: 12 | uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main 13 | with: 14 | commit_sha: ${{ github.sha }} 15 | package: hub-docs 16 | package_name: hub 17 | path_to_docs: hub-docs/docs/hub/ 18 | additional_args: --not_python_module 19 | secrets: 20 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 21 | -------------------------------------------------------------------------------- /.github/workflows/build_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build PR Documentation 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - "docs/hub/**" 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | build: 14 | uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main 15 | with: 16 | commit_sha: ${{ github.event.pull_request.head.sha }} 17 | pr_number: ${{ github.event.number }} 18 | package: hub-docs 19 | package_name: hub 20 | path_to_docs: hub-docs/docs/hub/ 21 | additional_args: --not_python_module 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/delete_doc_comment.yml: -------------------------------------------------------------------------------- 1 | name: Delete doc comment 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["Delete doc comment trigger", "Delete sagemaker doc comment trigger"] 6 | types: 7 | - completed 8 | 9 | 10 | jobs: 11 | delete: 12 | uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main 13 | secrets: 14 | comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/delete_doc_comment_trigger.yml: -------------------------------------------------------------------------------- 1 | name: Delete doc comment trigger 2 | 3 | on: 4 | pull_request: 5 | types: [ closed ] 6 | 7 | 8 | jobs: 9 | delete: 10 | uses: huggingface/doc-builder/.github/workflows/delete_doc_comment_trigger.yml@main 11 | with: 12 | pr_number: ${{ github.event.number }} 13 | 14 | -------------------------------------------------------------------------------- /.github/workflows/model_card_consistency_reminder.yml: -------------------------------------------------------------------------------- 1 | name: Model and Dataset Card consistency reminder 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - modelcard.md 7 | - datasetcard.md 8 | - docs/hub/datasets-cards.md 9 | - docs/hub/model-cards.md 10 | - docs/hub/model-card-annotated.md 11 | 12 | jobs: 13 | comment: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: maintain-comment 17 | uses: actions-cool/maintain-one-comment@v3 18 | with: 19 | body: | 20 | It looks like you've updated documentation related to model or dataset cards in this PR. 21 | 22 | Some content is duplicated among the following files. Please make sure that everything stays consistent. 23 | - [modelcard.md](https://github.com/huggingface/hub-docs/blob/main/modelcard.md) 24 | - [docs/hub/model-cards.md](https://github.com/huggingface/hub-docs/blob/main/docs/hub/model-cards.md) 25 | - [docs/hub/model-card-annotated.md](https://github.com/huggingface/hub-docs/blob/main/docs/hub/model-card-annotated.md) 26 | - [src/.../modelcard_template.md](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md) (`huggingface_hub` repo) 27 | - [src/.../datasetcard_template.md](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/datasetcard_template.md) (`huggingface_hub` repo) 28 | - [src/.../repocard.py](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/repocard.py) (`huggingface_hub` repo) 29 | - [datasetcard.md](https://github.com/huggingface/hub-docs/blob/main/datasetcard.md) 30 | - [docs/hub/datasets-cards.md](https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-cards.md) 31 | token: ${{ secrets.comment_bot_token }} 32 | body-include: '' 33 | -------------------------------------------------------------------------------- /.github/workflows/sagemaker_build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build SageMaker Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - doc-builder* 8 | paths: 9 | - docs/sagemaker/** 10 | - .github/workflows/sagemaker_build_documentation.yaml 11 | 12 | jobs: 13 | build: 14 | uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main 15 | with: 16 | commit_sha: ${{ github.sha }} 17 | package: hub-docs 18 | package_name: sagemaker 19 | path_to_docs: hub-docs/docs/sagemaker/source 20 | additional_args: --not_python_module 21 | pre_command: cd hub-docs/docs/sagemaker && make docs 22 | secrets: 23 | token: ${{ secrets.HUGGINGFACE_PUSH }} 24 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 25 | -------------------------------------------------------------------------------- /.github/workflows/sagemaker_build_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build SageMaker PR Documentation 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - docs/sagemaker/** 7 | - .github/workflows/sagemaker_build_pr_documentation.yaml 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | build: 15 | uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main 16 | with: 17 | commit_sha: ${{ github.event.pull_request.head.sha }} 18 | pr_number: ${{ github.event.number }} 19 | package: hub-docs 20 | package_name: sagemaker 21 | path_to_docs: hub-docs/docs/sagemaker/source 22 | additional_args: --not_python_module 23 | pre_command: cd hub-docs/docs/sagemaker && make docs 24 | -------------------------------------------------------------------------------- /.github/workflows/sagemaker_delete_doc_comment.yml: -------------------------------------------------------------------------------- 1 | name: Delete SageMaker PR Documentation Comment 2 | 3 | on: 4 | pull_request: 5 | types: [ closed ] 6 | 7 | jobs: 8 | delete: 9 | uses: huggingface/doc-builder/.github/workflows/delete_doc_comment_trigger.yml@main 10 | with: 11 | pr_number: ${{ github.event.number }} 12 | 13 | -------------------------------------------------------------------------------- /.github/workflows/sagemaker_upload_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Upload SageMaker PR Documentation 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["Build SageMaker PR Documentation"] 6 | types: 7 | - completed 8 | 9 | jobs: 10 | build: 11 | uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main 12 | with: 13 | package_name: sagemaker 14 | secrets: 15 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 16 | comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} 17 | -------------------------------------------------------------------------------- /.github/workflows/trufflehog.yml: -------------------------------------------------------------------------------- 1 | name: Secret Leaks 2 | 3 | on: 4 | push: 5 | 6 | permissions: 7 | contents: read 8 | 9 | jobs: 10 | trufflehog: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 0 17 | - name: Secret Scanning 18 | uses: trufflesecurity/trufflehog@main 19 | -------------------------------------------------------------------------------- /.github/workflows/upload_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Upload PR Documentation 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["Build PR Documentation"] 6 | types: 7 | - completed 8 | 9 | jobs: 10 | build: 11 | uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main 12 | with: 13 | package_name: hub 14 | secrets: 15 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 16 | comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | __pycache__/ 3 | .vscode/ 4 | .idea/ 5 | 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hub-docs 2 | 3 | This repository regroups documentation and information that is hosted on the Hugging Face website. 4 | 5 | You can access the Hugging Face Hub documentation in the `docs` folder at [hf.co/docs/hub](https://hf.co/docs/hub). 6 | 7 | For some related components, check out the [Hugging Face Hub JS repository](https://github.com/huggingface/huggingface.js) 8 | - Utilities to interact with the Hub: [huggingface/huggingface.js/packages/hub](https://github.com/huggingface/huggingface.js/tree/main/packages/hub) 9 | - Hub Inference, powered by our Inference Providers: [huggingface/huggingface.js/packages/inference](https://github.com/huggingface/huggingface.js/tree/main/packages/inference) 10 | - Hub Tasks (as visible on the page [hf.co/tasks](https://hf.co/tasks)): [huggingface/huggingface.js/packages/tasks](https://github.com/huggingface/huggingface.js/tree/main/packages/tasks) 11 | 12 | ### How to contribute to the docs 13 | 14 | Just add/edit the Markdown files, commit them, and create a PR. 15 | Then the CI bot will build the preview page and provide a url for you to look at the result! 16 | 17 | For simple edits, you don't need a local build environment. 18 | 19 | ### Previewing locally 20 | 21 | ```bash 22 | # install doc-builder (if not done already) 23 | pip install hf-doc-builder 24 | 25 | # you may also need to install some extra dependencies 26 | pip install black watchdog 27 | 28 | # run `doc-builder preview` cmd 29 | doc-builder preview hub {YOUR_PATH}/hub-docs/docs/hub/ --not_python_module 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/hub/_config.py: -------------------------------------------------------------------------------- 1 | disable_toc_check = True 2 | -------------------------------------------------------------------------------- /docs/hub/_redirects.yml: -------------------------------------------------------------------------------- 1 | # This first_section was backported from nginx 2 | adding-a-model: models-uploading 3 | model-repos: models 4 | endpoints: api 5 | adding-a-library: models-adding-libraries 6 | libraries: models-libraries 7 | inference: models-inference 8 | org-cards: organizations-cards 9 | adding-a-task: models-tasks 10 | models-cards: model-cards 11 | models-cards-co2: model-cards-co2 12 | how-to-downstream: /docs/huggingface_hub/how-to-downstream 13 | how-to-upstream: /docs/huggingface_hub/how-to-upstream 14 | how-to-inference: /docs/huggingface_hub/how-to-inference 15 | searching-the-hub: /docs/huggingface_hub/searching-the-hub 16 | # end of first_section 17 | api-webhook: webhooks 18 | adapter-transformers: adapters 19 | security-two-fa: security-2fa 20 | repositories-recommendations: storage-limits 21 | xet: storage-backends#xet 22 | -------------------------------------------------------------------------------- /docs/hub/academia-hub.md: -------------------------------------------------------------------------------- 1 | # Academia Hub 2 | 3 | 4 | Ask your university's IT or Procurement Team to get in touch from a university-affiliated email address to initiate the subscription process. 5 | 6 | 7 | Academia Hub is a paid offering that provides the Hugging Face Hub’s PRO features to every student, researcher, or faculty member of an academic institution. Explore advanced tools, enhanced collaboration, and exclusive resources to accelerate your learning, research, and teaching. The Hugging Face team is able to work with your IT or procurement department to set the product up. 8 | 9 | 10 | 11 | 12 | 13 | #### How does it work 14 | 15 | When Academia Hub is enabled, any affiliated user will need to add their `@your-university-name.edu` email address (or other university domain) to their HF account. 16 | 17 | Academia Hub is designed for: 18 | - **Students:** Unlock powerful features to learn about AI and Machine learning in the most efficient way. 19 | - **Researchers:** Collaborate with peers using the standard AI ecosystem of tools. 20 | - **Faculty members:** Enhance your classes' projects with PRO capabilities. 21 | 22 | Key Features of Academia Hub: 23 | 24 | - **ZeroGPU:** Get 5x usage quota and highest GPU queue priority. 25 | - **Spaces Hosting:** Create ZeroGPU Spaces with H200 hardware. 26 | - **Spaces Dev Mode:** Fast iterations via SSH/VS Code for Spaces. 27 | - **Inference Providers:** Get monthly included credits across all Inference Providers. 28 | - **Dataset Viewer:** Activate it on private datasets. 29 | - **Blog Articles:** Publish articles to the Hugging Face blog. 30 | - **Social Posts:** Share short updates with the community. 31 | - **Seamless Onboarding:** Quick and secure sign-up with your academic email. 32 | - **Enhanced Collaboration:** Connect with peers and mentors. 33 | - **Exclusive Resources:** Access datasets, models, and projects tailored for academia. 34 | 35 | #### Eligibility 36 | 37 | - Must possess a valid university or college email address. 38 | - Open to all students regardless of discipline or level of study. 39 | - Pricing: Academia Hub is priced based on volume of usage and number of active users at your institution. 40 | 41 | #### Subscribe 42 | 43 | Ask your university's IT or Procurement Team to get in touch to initiate the subscription process to the Academia Hub today. Academia Hub can not be initiated by students themselves. 44 | 45 | #### Private storage 46 | 47 | Academia Hub includes 1TB of [private repository storage](./storage-limits) per seat in the subscription, i.e. if your institution has 400 students and faculty, your students and faculty have 400TB included storage across their private models and datasets. 48 | -------------------------------------------------------------------------------- /docs/hub/advanced-compute-options.md: -------------------------------------------------------------------------------- 1 | # Advanced Compute Options 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Enterprise Hub organizations gain access to advanced compute options to accelerate their machine learning journey. 8 | 9 | ## Host ZeroGPU Spaces in your organization 10 | 11 | ZeroGPU is a dynamic GPU allocation system that optimizes AI deployment on Hugging Face Spaces. By automatically allocating and releasing NVIDIA H200 GPU slices (70GB VRAM) as needed, organizations can efficiently serve their AI applications without dedicated GPU instances. 12 | 13 |
14 | screenshot of Hugging Face Advanced Compute Options (ZeroGPU) 19 | 24 |
25 | 26 | **Key benefits for organizations** 27 | 28 | - **Free GPU Access**: Access powerful NVIDIA H200 GPUs at no additional cost through dynamic allocation 29 | - **Enhanced Resource Management**: Host up to 50 ZeroGPU Spaces for efficient team-wide AI deployment 30 | - **Simplified Deployment**: Easy integration with PyTorch-based models, Gradio apps, and other Hugging Face libraries 31 | - **Enterprise-Grade Infrastructure**: Access to high-performance NVIDIA H200 GPUs with 70GB VRAM per workload 32 | 33 | [Learn more about ZeroGPU →](https://huggingface.co/docs/hub/spaces-zerogpu) 34 | -------------------------------------------------------------------------------- /docs/hub/audit-logs.md: -------------------------------------------------------------------------------- 1 | # Audit Logs 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Audit Logs enable organization admins to easily review actions taken by members, including organization membership, repository settings and billing changes. 8 | 9 |
10 | screenshot of Hugging Face Audit Logs feature 15 | 20 |
21 | 22 | ## Accessing Audit Logs 23 | 24 | Audit Logs are accessible through your organization settings. Each log entry includes: 25 | 26 | - Who performed the action 27 | - What type of action was taken 28 | - A description of the change 29 | - Location and anonymized IP address 30 | - Date and time of the action 31 | 32 | You can also download the complete audit log as a JSON file for further analysis. 33 | 34 | ## What Events Are Tracked? 35 | 36 | ### Organization Management & Security 37 | 38 | - Core organization changes 39 | - Creation, deletion, and restoration 40 | - Name changes and settings updates 41 | - Security management 42 | - Security token rotation 43 | - Token approval system (enabling/disabling, authorization requests, approvals, denials, revocations) 44 | - SSO events (logins and joins) 45 | 46 | ### Membership and Access Control 47 | 48 | - Member lifecycle 49 | - Invitations (sending, accepting) and automatic joins 50 | - Adding and removing members 51 | - Role changes and departures 52 | - Join settings 53 | - Domain-based access 54 | - Automatic join configurations 55 | 56 | ### Content and Resource Management 57 | 58 | - Repository administration 59 | - Core actions (creation, deletion, moving, duplication) 60 | - Settings and configuration changes 61 | - Enabling/disabling repositories 62 | - DOI management 63 | - Resource group assignments 64 | - Collections 65 | - Creation and deletion events 66 | - Repository security 67 | - Secrets management (individual and bulk) 68 | - Variables handling (individual and bulk) 69 | - Spaces configuration 70 | - Storage modifications 71 | - Hardware settings 72 | - Sleep time adjustments 73 | 74 | ### Billing and AWS Integration 75 | 76 | - Payment management 77 | - Payment methods (adding/removing) 78 | - Customer account creation 79 | - AWS integration setup and removal 80 | - Subscription lifecycle 81 | - Starting and renewing 82 | - Updates and cancellations 83 | - Cancellation reversals 84 | 85 | ### Resource Groups 86 | 87 | - Administrative actions 88 | - Creation and deletion 89 | - Settings modifications 90 | - Member management 91 | - Adding and removing users 92 | - Role assignments and changes 93 | -------------------------------------------------------------------------------- /docs/hub/datasets-download-stats.md: -------------------------------------------------------------------------------- 1 | # Datasets Download Stats 2 | 3 | ## How are downloads counted for datasets? 4 | 5 | Counting the number of downloads for datasets is not a trivial task, as a single dataset repository might contain multiple files, from multiple subsets and splits (e.g. train/validation/test) and sometimes with many files in a single split. To solve this issue and avoid counting one person's download multiple times, we treat all files downloaded by a user (based on their IP address) within a 5-minute window as a single dataset download. This counting happens automatically on our servers when files are downloaded (through GET or HEAD requests), with no need to collect any user information or make additional calls. 6 | 7 | ## Before September 2024 8 | 9 | The Hub used to provide download stats only for the datasets loadable via the `datasets` library. To determine the number of downloads, the Hub previously counted every time `load_dataset` was called in Python, excluding Hugging Face's CI tooling on GitHub. No information was sent from the user, and no additional calls were made for this. The count was done server-side as we served files for downloads. This means that: 10 | 11 | * The download count was the same regardless of whether the data is directly stored on the Hub repo or if the repository has a [script](/docs/datasets/dataset_script) to load the data from an external source. 12 | * If a user manually downloaded the data using tools like `wget` or the Hub's user interface (UI), those downloads were not included in the download count. 13 | -------------------------------------------------------------------------------- /docs/hub/datasets-downloading.md: -------------------------------------------------------------------------------- 1 | # Downloading datasets 2 | 3 | ## Integrated libraries 4 | 5 | If a dataset on the Hub is tied to a [supported library](./datasets-libraries), loading the dataset can be done in just a few lines. For information on accessing the dataset, you can click on the "Use this dataset" button on the dataset page to see how to do so. For example, [`samsum`](https://huggingface.co/datasets/Samsung/samsum?library=datasets) shows how to do so with 🤗 Datasets below. 6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 | ## Using the Hugging Face Client Library 18 | 19 | You can use the [`huggingface_hub`](/docs/huggingface_hub) library to create, delete, update and retrieve information from repos. For example, to download the `HuggingFaceH4/ultrachat_200k` dataset from the command line, run 20 | 21 | ```bash 22 | huggingface-cli download HuggingFaceH4/ultrachat_200k --repo-type dataset 23 | ``` 24 | 25 | See the [huggingface-cli download documentation](https://huggingface.co/docs/huggingface_hub/en/guides/cli#download-a-dataset-or-a-space) for more information. 26 | 27 | You can also integrate this into your own library! For example, you can quickly load a CSV dataset with a few lines using Pandas. 28 | ```py 29 | from huggingface_hub import hf_hub_download 30 | import pandas as pd 31 | 32 | REPO_ID = "YOUR_REPO_ID" 33 | FILENAME = "data.csv" 34 | 35 | dataset = pd.read_csv( 36 | hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="dataset") 37 | ) 38 | ``` 39 | 40 | ## Using Git 41 | 42 | Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running: 43 | 44 | ```bash 45 | git lfs install 46 | git clone git@hf.co:datasets/ # example: git clone git@hf.co:datasets/allenai/c4 47 | ``` 48 | 49 | If you have write-access to the particular dataset repo, you'll also have the ability to commit and push revisions to the dataset. 50 | 51 | Add your SSH public key to [your user settings](https://huggingface.co/settings/keys) to push changes and/or access private repos. 52 | -------------------------------------------------------------------------------- /docs/hub/datasets-duckdb-auth.md: -------------------------------------------------------------------------------- 1 | # Authentication for private and gated datasets 2 | 3 | To access private or gated datasets, you need to configure your Hugging Face Token in the DuckDB Secrets Manager. 4 | 5 | Visit [Hugging Face Settings - Tokens](https://huggingface.co/settings/tokens) to obtain your access token. 6 | 7 | DuckDB supports two providers for managing secrets: 8 | 9 | - `CONFIG`: Requires the user to pass all configuration information into the CREATE SECRET statement. 10 | - `CREDENTIAL_CHAIN`: Automatically tries to fetch credentials. For the Hugging Face token, it will try to get it from `~/.cache/huggingface/token`. 11 | 12 | For more information about DuckDB Secrets visit the [Secrets Manager](https://duckdb.org/docs/configuration/secrets_manager.html) guide. 13 | 14 | ## Creating a secret with `CONFIG` provider 15 | 16 | To create a secret using the CONFIG provider, use the following command: 17 | 18 | ```bash 19 | CREATE SECRET hf_token (TYPE HUGGINGFACE, TOKEN 'your_hf_token'); 20 | ``` 21 | 22 | Replace `your_hf_token` with your actual Hugging Face token. 23 | 24 | ## Creating a secret with `CREDENTIAL_CHAIN` provider 25 | 26 | To create a secret using the CREDENTIAL_CHAIN provider, use the following command: 27 | 28 | ```bash 29 | CREATE SECRET hf_token (TYPE HUGGINGFACE, PROVIDER credential_chain); 30 | ``` 31 | 32 | This command automatically retrieves the stored token from `~/.cache/huggingface/token`. 33 | 34 | First you need to [Login with your Hugging Face account](/docs/huggingface_hub/quick-start#login), for example using: 35 | 36 | ```bash 37 | huggingface-cli login 38 | ``` 39 | 40 | Alternatively, you can set your Hugging Face token as an environment variable: 41 | 42 | ```bash 43 | export HF_TOKEN="hf_xxxxxxxxxxxxx" 44 | ``` 45 | 46 | For more information on authentication, see the [Hugging Face authentication](/docs/huggingface_hub/main/en/quick-start#authentication) documentation. 47 | -------------------------------------------------------------------------------- /docs/hub/datasets-duckdb.md: -------------------------------------------------------------------------------- 1 | # DuckDB 2 | 3 | [DuckDB](https://github.com/duckdb/duckdb) is an in-process SQL [OLAP](https://en.wikipedia.org/wiki/Online_analytical_processing) database management system. 4 | You can use the Hugging Face paths (`hf://`) to access data on the Hub: 5 | 6 |
7 | 8 |
9 | 10 | The [DuckDB CLI](https://duckdb.org/docs/api/cli/overview.html) (Command Line Interface) is a single, dependency-free executable. 11 | There are also other APIs available for running DuckDB, including Python, C++, Go, Java, Rust, and more. For additional details, visit their [clients](https://duckdb.org/docs/api/overview.html) page. 12 | 13 | 14 | 15 | For installation details, visit the [installation page](https://duckdb.org/docs/installation). 16 | 17 | 18 | 19 | Starting from version `v0.10.3`, the DuckDB CLI includes native support for accessing datasets on the Hugging Face Hub via URLs with the `hf://` scheme. Here are some features you can leverage with this powerful tool: 20 | 21 | - Query public datasets and your own gated and private datasets 22 | - Analyze datasets and perform SQL operations 23 | - Combine datasets and export it to different formats 24 | - Conduct vector similarity search on embedding datasets 25 | - Implement full-text search on datasets 26 | 27 | For a complete list of DuckDB features, visit the DuckDB [documentation](https://duckdb.org/docs/). 28 | 29 | To start the CLI, execute the following command in the installation folder: 30 | 31 | ```bash 32 | ./duckdb 33 | ``` 34 | 35 | ## Forging the Hugging Face URL 36 | 37 | To access Hugging Face datasets, use the following URL format: 38 | 39 | ```plaintext 40 | hf://datasets/{my-username}/{my-dataset}/{path_to_file} 41 | ``` 42 | 43 | - **my-username**, the user or organization of the dataset, e.g. `ibm` 44 | - **my-dataset**, the dataset name, e.g: `duorc` 45 | - **path_to_parquet_file**, the parquet file path which supports glob patterns, e.g `**/*.parquet`, to query all parquet files 46 | 47 | 48 | 49 | 50 | You can query auto-converted Parquet files using the @~parquet branch, which corresponds to the `refs/convert/parquet` revision. For more details, refer to the documentation at https://huggingface.co/docs/datasets-server/en/parquet#conversion-to-parquet. 51 | 52 | To reference the `refs/convert/parquet` revision of a dataset, use the following syntax: 53 | 54 | ```plaintext 55 | hf://datasets/{my-username}/{my-dataset}@~parquet/{path_to_file} 56 | ``` 57 | 58 | Here is a sample URL following the above syntax: 59 | 60 | ```plaintext 61 | hf://datasets/ibm/duorc@~parquet/ParaphraseRC/test/0000.parquet 62 | ``` 63 | 64 | 65 | 66 | Let's start with a quick demo to query all the rows of a dataset: 67 | 68 | ```sql 69 | FROM 'hf://datasets/ibm/duorc/ParaphraseRC/*.parquet' LIMIT 3; 70 | ``` 71 | 72 | Or using traditional SQL syntax: 73 | 74 | ```sql 75 | SELECT * FROM 'hf://datasets/ibm/duorc/ParaphraseRC/*.parquet' LIMIT 3; 76 | ``` 77 | In the following sections, we will cover more complex operations you can perform with DuckDB on Hugging Face datasets. 78 | -------------------------------------------------------------------------------- /docs/hub/datasets-overview.md: -------------------------------------------------------------------------------- 1 | # Datasets Overview 2 | 3 | ## Datasets on the Hub 4 | 5 | The Hugging Face Hub hosts a [large number of community-curated datasets](https://huggingface.co/datasets) for a diverse range of tasks such as translation, automatic speech recognition, and image classification. Alongside the information contained in the [dataset card](./datasets-cards), many datasets, such as [GLUE](https://huggingface.co/datasets/nyu-mll/glue), include a [Dataset Viewer](./datasets-viewer) to showcase the data. 6 | 7 | Each dataset is a [Git repository](./repositories) that contains the data required to generate splits for training, evaluation, and testing. For information on how a dataset repository is structured, refer to the [Data files Configuration page](./datasets-data-files-configuration). Following the supported repo structure will ensure that the dataset page on the Hub will have a Viewer. 8 | 9 | ## Search for datasets 10 | 11 | Like models and spaces, you can search the Hub for datasets using the search bar in the top navigation or on the [main datasets page](https://huggingface.co/datasets). There's a large number of languages, tasks, and licenses that you can use to filter your results to find a dataset that's right for you. 12 | 13 |
14 | 15 | 16 |
17 | 18 | ## Privacy 19 | 20 | Since datasets are repositories, you can [toggle their visibility between private and public](./repositories-settings#private-repositories) through the Settings tab. If a dataset is owned by an [organization](./organizations), the privacy settings apply to all the members of the organization. 21 | -------------------------------------------------------------------------------- /docs/hub/datasets-polars-auth.md: -------------------------------------------------------------------------------- 1 | # Authentication 2 | 3 | In order to access private or gated datasets, you need to authenticate first. Authentication works by providing an access token which will be used to authenticate and authorize your access to gated and private datasets. The first step is to create an access token for your account. This can be done by visiting [Hugging Face Settings - Tokens](https://huggingface.co/settings/tokens). 4 | 5 | There are three ways to provide the token: setting an environment variable, passing a parameter to the reader or using the Hugging Face CLI. 6 | 7 | ## Environment variable 8 | 9 | If you set the environment variable `HF_TOKEN`, Polars will automatically use it when requesting datasets from Hugging Face. 10 | 11 | ```bash 12 | export HF_TOKEN="hf_xxxxxxxxxxxxx" 13 | ``` 14 | 15 | ## Parameters 16 | 17 | You can also explicitly provide the access token to the reader (e.g. `read_parquet`) through the `storage_options` parameter. For a full overview of all the parameters, check out the [API reference guide](https://docs.pola.rs/api/python/stable/reference/api/polars.read_parquet.html). 18 | 19 | ```python 20 | pl.read_parquet( 21 | "hf://datasets/roneneldan/TinyStories/data/train-*.parquet", 22 | storage_options={"token": ACCESS_TOKEN}, 23 | ) 24 | ``` 25 | 26 | ## CLI 27 | 28 | Alternatively, you can you use the [Hugging Face CLI](/docs/huggingface_hub/en/guides/cli) to authenticate. After successfully logging in with `huggingface-cli login` an access token will be stored in the `HF_HOME` directory which defaults to `~/.cache/huggingface`. Polars will then use this token for authentication. 29 | 30 | If multiple methods are specified, they are prioritized in the following order: 31 | 32 | - Parameters (`storage_options`) 33 | - Environment variable (`HF_TOKEN`) 34 | - CLI 35 | -------------------------------------------------------------------------------- /docs/hub/datasets-polars-file-formats.md: -------------------------------------------------------------------------------- 1 | # File formats 2 | 3 | Polars supports the following file formats when reading from Hugging Face: 4 | 5 | - [Parquet](https://docs.pola.rs/api/python/stable/reference/api/polars.read_parquet.html) 6 | - [CSV](https://docs.pola.rs/api/python/stable/reference/api/polars.read_csv.html) 7 | - [JSON Lines](https://docs.pola.rs/api/python/stable/reference/api/polars.read_ndjson.html) 8 | 9 | The examples below show the default settings only. Use the links above to view all available parameters in the API reference guide. 10 | 11 | # Parquet 12 | 13 | Parquet is the preferred file format as it stores the schema with type information within the file. This avoids any ambiguity with parsing and speeds up reading. To read a Parquet file in Polars, use the `read_parquet` function: 14 | 15 | ```python 16 | pl.read_parquet("hf://datasets/roneneldan/TinyStories/data/train-00000-of-00004-2d5a1467fff1081b.parquet") 17 | ``` 18 | 19 | # CSV 20 | 21 | The `read_csv` function can be used to read a CSV file: 22 | 23 | ```python 24 | pl.read_csv("hf://datasets/lhoestq/demo1/data/train.csv") 25 | ``` 26 | 27 | # JSON 28 | 29 | Polars supports reading new line delimited JSON — also known as [json lines](https://jsonlines.org/) — with the `read_ndjson` function: 30 | 31 | ```python 32 | pl.read_ndjson("hf://datasets/proj-persona/PersonaHub/persona.jsonl") 33 | ``` -------------------------------------------------------------------------------- /docs/hub/datasets-polars.md: -------------------------------------------------------------------------------- 1 | # Polars 2 | 3 | [Polars](https://pola.rs/) is an in-memory DataFrame library on top of an [OLAP](https://en.wikipedia.org/wiki/Online_analytical_processing) query engine. It is fast, easy to use, and [open source](https://github.com/pola-rs/polars/). 4 | 5 | Starting from version `1.2.0`, Polars provides _native_ support for the Hugging Face file system. This means that all the benefits of the Polars query optimizer (e.g. predicate and projection pushdown) are applied and Polars will only load the data necessary to complete the query. This significantly speeds up reading, especially for large datasets (see [optimizations](./datasets-polars-optimizations)) 6 | 7 | You can use the Hugging Face paths (`hf://`) to access data on the Hub: 8 | 9 |
10 | 11 |
12 | 13 | ## Getting started 14 | 15 | To get started, you can simply `pip install` Polars into your environment: 16 | 17 | ```bash 18 | pip install polars 19 | ``` 20 | 21 | Once you have installed Polars, you can directly query a dataset based on a Hugging Face URL. No other dependencies are needed for this. 22 | 23 | ```python 24 | import polars as pl 25 | 26 | pl.read_parquet("hf://datasets/roneneldan/TinyStories/data/train-00000-of-00004-2d5a1467fff1081b.parquet") 27 | ``` 28 | 29 | 30 | 31 | Polars provides two APIs: a lazy API (`scan_parquet`) and an eager API (`read_parquet`). We recommend using the eager API for interactive workloads and the lazy API for performance as it allows for better query optimization. For more information on the topic, check out the [Polars user guide](https://docs.pola.rs/user-guide/concepts/lazy-vs-eager/). 32 | 33 | 34 | 35 | Polars supports globbing to download multiple files at once into a single DataFrame. 36 | 37 | ```python 38 | pl.read_parquet("hf://datasets/roneneldan/TinyStories/data/train-*.parquet") 39 | ``` 40 | 41 | ### Hugging Face URLs 42 | 43 | A Hugging Face URL can be constructed from the `username` and `dataset` name like this: 44 | 45 | - `hf://datasets/{username}/{dataset}/{path_to_file}` 46 | 47 | The path may include globbing patterns such as `**/*.parquet` to query all the files matching the pattern. Additionally, for any non-supported [file formats](./datasets-polars-file-formats) you can use the auto-converted parquet files that Hugging Face provides using the `@~parquet branch`: 48 | 49 | - `hf://datasets/{my-username}/{my-dataset}@~parquet/{path_to_file}` 50 | -------------------------------------------------------------------------------- /docs/hub/datasets-usage.md: -------------------------------------------------------------------------------- 1 | # Using 🤗 Datasets 2 | 3 | Once you've found an interesting dataset on the Hugging Face Hub, you can load the dataset using 🤗 Datasets. You can click on the [**Use this dataset** button](https://huggingface.co/datasets/nyu-mll/glue?library=datasets) to copy the code to load a dataset. 4 | 5 | First you need to [Login with your Hugging Face account](/docs/huggingface_hub/quick-start#login), for example using: 6 | 7 | ``` 8 | huggingface-cli login 9 | ``` 10 | 11 | And then you can load a dataset from the Hugging Face Hub using 12 | 13 | ```python 14 | from datasets import load_dataset 15 | 16 | dataset = load_dataset("username/my_dataset") 17 | 18 | # or load the separate splits if the dataset has train/validation/test splits 19 | train_dataset = load_dataset("username/my_dataset", split="train") 20 | valid_dataset = load_dataset("username/my_dataset", split="validation") 21 | test_dataset = load_dataset("username/my_dataset", split="test") 22 | ``` 23 | 24 | You can also upload datasets to the Hugging Face Hub: 25 | 26 | ```python 27 | my_new_dataset.push_to_hub("username/my_new_dataset") 28 | ``` 29 | 30 | This creates a dataset repository `username/my_new_dataset` containing your Dataset in Parquet format, that you can reload later. 31 | 32 | For more information about using 🤗 Datasets, check out the [tutorials](/docs/datasets/tutorial) and [how-to guides](/docs/datasets/how_to) available in the 🤗 Datasets documentation. 33 | -------------------------------------------------------------------------------- /docs/hub/datasets-viewer-configure.md: -------------------------------------------------------------------------------- 1 | # Configure the Dataset Viewer 2 | 3 | The Dataset Viewer supports many [data files formats](./datasets-adding#file-formats), from text to tabular and from image to audio formats. 4 | It also separates the train/validation/test splits based on file and folder names. 5 | 6 | To configure the Dataset Viewer for your dataset, first make sure your dataset is in a [supported data format](./datasets-adding#file-formats). 7 | 8 | ## Configure dropdowns for splits or subsets 9 | 10 | In the Dataset Viewer you can view the [train/validation/test](https://en.wikipedia.org/wiki/Training,_validation,_and_test_data_sets) splits of datasets, and sometimes additionally choose between multiple subsets (e.g. one per language). 11 | 12 | To define those dropdowns, you can name the data files or their folder after their split names (train/validation/test). 13 | It is also possible to customize your splits manually using YAML. 14 | 15 | For more information, feel free to check out the documentation on [Data files Configuration](./datasets-data-files-configuration) and the [collections of example datasets](https://huggingface.co/datasets-examples). The [Image Dataset doc page](./datasets-image) proposes various methods to structure a dataset with images. 16 | 17 | ## Disable the viewer 18 | 19 | The dataset viewer can be disabled. To do this, add a YAML section to the dataset's `README.md` file (create one if it does not already exist) and add a `viewer` property with the value `false`. 20 | 21 | ```yaml 22 | --- 23 | viewer: false 24 | --- 25 | ``` 26 | 27 | ## Private datasets 28 | 29 | For **private** datasets, the Dataset Viewer is enabled for [PRO users](https://huggingface.co/pricing) and [Enterprise Hub organizations](https://huggingface.co/enterprise). 30 | -------------------------------------------------------------------------------- /docs/hub/datasets.md: -------------------------------------------------------------------------------- 1 | # Datasets 2 | 3 | The Hugging Face Hub is home to a growing collection of datasets that span a variety of domains and tasks. These docs will guide you through interacting with the datasets on the Hub, uploading new datasets, exploring the datasets contents, and using datasets in your projects. 4 | 5 | This documentation focuses on the datasets functionality in the Hugging Face Hub and how to use the datasets with supported libraries. For detailed information about the 🤗 Datasets python package, visit the [🤗 Datasets documentation](/docs/datasets/index). 6 | 7 | ## Contents 8 | 9 | - [Datasets Overview](./datasets-overview) 10 | - [Dataset Cards](./datasets-cards) 11 | - [Gated Datasets](./datasets-gated) 12 | - [Uploading Datasets](./datasets-adding) 13 | - [Downloading Datasets](./datasets-downloading) 14 | - [Libraries](./datasets-libraries) 15 | - [Dataset Viewer](./datasets-viewer) 16 | - [Data files Configuration](./datasets-data-files-configuration) 17 | -------------------------------------------------------------------------------- /docs/hub/enterprise-hub-advanced-security.md: -------------------------------------------------------------------------------- 1 | # Advanced Security 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Enterprise Hub organizations can improve their security with advanced security controls for both members and repositories. 8 | 9 |
10 | screenshot of the Dataset Viewer on a private dataset owned by an Enterprise Hub organization. 11 | 12 |
13 | 14 | ## Members Security 15 | 16 | Configure additional security settings to protect your organization: 17 | 18 | - **Two-Factor Authentication (2FA)**: Require all organization members to enable 2FA for enhanced account security. 19 | - **User Approval**: For organizations with a verified domain name, require admin approval for new users with matching email addresses. This adds a verified badge to your organization page. 20 | 21 | ## Repository Visibility Controls 22 | 23 | Manage the default visibility of repositories in your organization: 24 | 25 | - **Public by default**: New repositories are created with public visibility 26 | - **Private by default**: New repositories are created with private visibility. Note that changing this setting will not affect existing repositories. 27 | - **Private only**: Enforce private visibility for all new repositories, with only organization admins able to change visibility settings 28 | 29 | These settings help organizations maintain control of their ownership while enabling collaboration when needed. 30 | -------------------------------------------------------------------------------- /docs/hub/enterprise-hub-analytics.md: -------------------------------------------------------------------------------- 1 | # Analytics 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | ## Analytics Dashboard 8 | 9 | Track all your repository activity with a detailed downloads overview that shows total downloads for all your Models and Datasets. Toggle between "All Time" and "Last Month" views to gain insights into your repository's downloads over different periods. 10 | 11 |
12 | screenshot of the Dataset Viewer on a private dataset owned by an Enterprise Hub organization. 13 | 14 |
15 | 16 | ### Per-repo breakdown 17 | 18 | Explore the metrics of individual repositories with the per-repository drill-down table. Utilize the built-in search feature to quickly locate specific repositories. Each row also features a time-series graph that illustrates the trend of downloads over time. 19 | 20 | ## Export Analytics as CSV 21 | 22 | Download a comprehensive CSV file containing analytics for all your repositories, including model and dataset download activity. 23 | 24 | ### Response Structure 25 | 26 | The CSV file is made of daily download records for each of your models and datasets. 27 | 28 | ```csv 29 | repoType,repoName,total,timestamp,downloads 30 | model,huggingface/CodeBERTa-small-v1,4362460,2021-01-22T00:00:00.000Z,4 31 | model,huggingface/CodeBERTa-small-v1,4362460,2021-01-23T00:00:00.000Z,7 32 | model,huggingface/CodeBERTa-small-v1,4362460,2021-01-24T00:00:00.000Z,2 33 | dataset,huggingface/documentation-images,2167284,2021-11-27T00:00:00.000Z,3 34 | dataset,huggingface/documentation-images,2167284,2021-11-28T00:00:00.000Z,18 35 | dataset,huggingface/documentation-images,2167284,2021-11-29T00:00:00.000Z,7 36 | ``` 37 | 38 | ### Repository Object Structure 39 | 40 | Each record in the CSV contains: 41 | 42 | - `repoType`: The type of repository (e.g., "model", "dataset") 43 | - `repoName`: Full repository name including organization (e.g., "huggingface/documentation-images") 44 | - `total`: Cumulative number of downloads for this repository 45 | - `timestamp`: ISO 8601 formatted date (UTC) 46 | - `downloads`: Number of downloads for that day 47 | 48 | Records are ordered chronologically and provide a daily granular view of download activity for each repository. 49 | -------------------------------------------------------------------------------- /docs/hub/enterprise-hub-datasets.md: -------------------------------------------------------------------------------- 1 | # Datasets 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Data Studio is enabled on private datasets under your Enterprise Hub organization. 8 | 9 | Data Studio allows teams to understand their data and to help them build better data processing and filtering for AI. This powerful viewer allows you to explore dataset content, inspect data distributions, filter by values, search for keywords, or even run SQL queries on your data without leaving your browser. 10 | 11 | More information about [Data Studio](./datasets-viewer). 12 | 13 |
14 | screenshot of Data Studio on a private dataset owned by an Enterprise Hub organization. 15 | 16 |
17 | -------------------------------------------------------------------------------- /docs/hub/enterprise-hub-resource-groups.md: -------------------------------------------------------------------------------- 1 | # Resource groups 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Resource Groups allow organizations to enforce fine-grained access control to their repositories. 8 | 9 |
10 | screenshot of Hugging Face Single Sign-On (SSO) feature 15 | 20 |
21 | 22 | This feature allows organization administrators to: 23 | 24 | - Group related repositories together for better organization 25 | - Control member access at a group level rather than individual repository level 26 | - Assign different permission roles (read, contributor, write, admin) to team members 27 | - Keep private repositories visible only to authorized group members 28 | - Enable multiple teams to work independently within the same organization 29 | 30 | This Enterprise Hub feature helps organizations manage complex team structures and maintain proper access control over their repositories. 31 | 32 | [Getting started with Resource Groups →](./security-resource-groups) 33 | -------------------------------------------------------------------------------- /docs/hub/enterprise-hub.md: -------------------------------------------------------------------------------- 1 | # Enterprise Hub 2 | 3 | 4 | Subscribe to Enterprise Hub to get access to advanced features for your organization. 5 | 6 | 7 | Enterprise Hub adds advanced capabilities to organizations, enabling safe, compliant and managed collaboration for companies and teams on Hugging Face. 8 | 9 | 10 | 11 | 12 | 13 | 14 | In this section we will document the following Enterprise Hub features: 15 | 16 | - [Single Sign-On (SSO)](./enterprise-sso) 17 | - [Advanced Single Sign-On (SSO)](./enterprise-hub-advanced-sso) 18 | - [Audit Logs](./audit-logs) 19 | - [Storage Regions](./storage-regions) 20 | - [Dataset viewer for Private datasets](./enterprise-hub-datasets) 21 | - [Resource Groups](./security-resource-groups) 22 | - [Advanced Compute Options](./advanced-compute-options) 23 | - [Advanced Security](./enterprise-hub-advanced-security) 24 | - [Tokens Management](./enterprise-hub-tokens-management) 25 | - [Analytics](./enterprise-hub-analytics) 26 | - [Network Security](./enterprise-hub-network-security) 27 | - [Gating Group Collections](./enterprise-hub-gating-group-collections) 28 | 29 | Finally, Enterprise Hub includes 1TB of [private repository storage](./storage-limits) per seat in the subscription, i.e. if your organization has 40 members, then you have 40TB included storage for your private models and datasets. 30 | -------------------------------------------------------------------------------- /docs/hub/enterprise-sso.md: -------------------------------------------------------------------------------- 1 | # Single Sign-On (SSO) 2 | 3 | 4 | This feature is part of the Enterprise Hub. 5 | 6 | 7 | Single sign-on (SSO) allows organizations to securely manage user authentication through their own identity provider (IdP). Both SAML 2.0 and OpenID Connect (OIDC) protocols are supported. 8 | 9 | Please note that this feature is intended to manage access to organization-specific resources such as private models, datasets, and Spaces. However, it does not replace the core authentication mechanism for the Hugging Face platform. For enhanced capabilities like automated user provisioning (JIT/SCIM) and global SSO enforcement, see our [Advanced SSO documentation](./enterprise-hub-advanced-sso). 10 | 11 |
12 | screenshot of Hugging Face Single Sign-On (SSO) feature 17 | 22 |
23 | 24 | This feature allows organizations to: 25 | 26 | - Enforce mandatory authentication through your company's IdP 27 | - Automatically manage user access and roles based on your IdP attributes 28 | - Support popular providers like Okta, OneLogin, and Azure Active Directory 29 | - Maintain security while allowing external collaborators when needed 30 | - Control session timeouts and role mappings 31 | 32 | This Enterprise Hub feature helps organizations maintain consistent security policies while giving their teams seamless access to Hugging Face resources. 33 | 34 | [Getting started with SSO →](./security-sso) 35 | -------------------------------------------------------------------------------- /docs/hub/fastai.md: -------------------------------------------------------------------------------- 1 | # Using fastai at Hugging Face 2 | 3 | `fastai` is an open-source Deep Learning library that leverages PyTorch and Python to provide high-level components to train fast and accurate neural networks with state-of-the-art outputs on text, vision, and tabular data. 4 | 5 | ## Exploring fastai in the Hub 6 | 7 | You can find `fastai` models by filtering at the left of the [models page](https://huggingface.co/models?library=fastai&sort=downloads). 8 | 9 | All models on the Hub come up with the following features: 10 | 1. An automatically generated model card with a brief description and metadata tags that help for discoverability. 11 | 2. An interactive widget you can use to play out with the model directly in the browser (for Image Classification) 12 | 3. An Inference API that allows to make inference requests (for Image Classification). 13 | 14 | 15 | ## Using existing models 16 | 17 | The `huggingface_hub` library is a lightweight Python client with utlity functions to download models from the Hub. 18 | 19 | ```bash 20 | pip install huggingface_hub["fastai"] 21 | ``` 22 | 23 | Once you have the library installed, you just need to use the `from_pretrained_fastai` method. This method not only loads the model, but also validates the `fastai` version when the model was saved, which is important for reproducibility. 24 | 25 | ```py 26 | from huggingface_hub import from_pretrained_fastai 27 | 28 | learner = from_pretrained_fastai("espejelomar/identify-my-cat") 29 | 30 | _,_,probs = learner.predict(img) 31 | print(f"Probability it's a cat: {100*probs[1].item():.2f}%") 32 | 33 | # Probability it's a cat: 100.00% 34 | ``` 35 | 36 | 37 | If you want to see how to load a specific model, you can click `Use in fastai` and you will be given a working snippet that you can load it! 38 | 39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 |
47 | 48 | ## Sharing your models 49 | 50 | You can share your `fastai` models by using the `push_to_hub_fastai` method. 51 | 52 | ```py 53 | from huggingface_hub import push_to_hub_fastai 54 | 55 | push_to_hub_fastai(learner=learn, repo_id="espejelomar/identify-my-cat") 56 | ``` 57 | 58 | 59 | ## Additional resources 60 | 61 | * fastai [course](https://course.fast.ai/). 62 | * fastai [website](https://www.fast.ai/). 63 | * Integration with Hub [docs](https://docs.fast.ai/huggingface.html). 64 | * Integration with Hub [announcement](https://huggingface.co/blog/fastai). 65 | -------------------------------------------------------------------------------- /docs/hub/flair.md: -------------------------------------------------------------------------------- 1 | # Using Flair at Hugging Face 2 | 3 | [Flair](https://github.com/flairNLP/flair) is a very simple framework for state-of-the-art NLP. 4 | Developed by [Humboldt University of Berlin](https://www.informatik.hu-berlin.de/en/forschung-en/gebiete/ml-en/) and friends. 5 | 6 | ## Exploring Flair in the Hub 7 | 8 | You can find `flair` models by filtering at the left of the [models page](https://huggingface.co/models?library=flair). 9 | 10 | All models on the Hub come with these useful features: 11 | 12 | 1. An automatically generated model card with a brief description. 13 | 2. An interactive widget you can use to play with the model directly in the browser. 14 | 3. An Inference API that allows you to make inference requests. 15 | 16 | ## Installation 17 | 18 | To get started, you can follow the [Flair installation guide](https://github.com/flairNLP/flair?tab=readme-ov-file#requirements-and-installation). 19 | You can also use the following one-line install through pip: 20 | 21 | ``` 22 | $ pip install -U flair 23 | ``` 24 | 25 | ## Using existing models 26 | 27 | All `flair` models can easily be loaded from the Hub: 28 | 29 | ```py 30 | from flair.data import Sentence 31 | from flair.models import SequenceTagger 32 | 33 | # load tagger 34 | tagger = SequenceTagger.load("flair/ner-multi") 35 | ``` 36 | 37 | Once loaded, you can use `predict()` to perform inference: 38 | 39 | ```py 40 | sentence = Sentence("George Washington ging nach Washington.") 41 | tagger.predict(sentence) 42 | 43 | # print sentence 44 | print(sentence) 45 | ``` 46 | 47 | It outputs the following: 48 | 49 | ```text 50 | Sentence[6]: "George Washington ging nach Washington." → ["George Washington"/PER, "Washington"/LOC] 51 | ``` 52 | 53 | If you want to load a specific Flair model, you can click `Use in Flair` in the model card and you will be given a working snippet! 54 | 55 |
56 | 57 | 58 |
59 |
60 | 61 | 62 |
63 | 64 | ## Additional resources 65 | 66 | * Flair [repository](https://github.com/flairNLP/flair) 67 | * Flair [docs](https://flairnlp.github.io/docs/intro) 68 | * Official Flair [models](https://huggingface.co/flair) on the Hub (mainly trained by [@alanakbik](https://huggingface.co/alanakbik) and [@stefan-it](https://huggingface.co/stefan-it)) -------------------------------------------------------------------------------- /docs/hub/gguf-gpt4all.md: -------------------------------------------------------------------------------- 1 | # GGUF usage with GPT4All 2 | 3 | [GPT4All](https://gpt4all.io/) is an open-source LLM application developed by [Nomic](https://nomic.ai/). Version 2.7.2 introduces a brand new, experimental feature called `Model Discovery`. 4 | 5 | `Model Discovery` provides a built-in way to search for and download GGUF models from the Hub. To get started, open GPT4All and click `Download Models`. From here, you can use the search bar to find a model. 6 | 7 |
8 | 9 | 10 |
11 | 12 | After you have selected and downloaded a model, you can go to `Settings` and provide an appropriate prompt template in the GPT4All format (`%1` and `%2` placeholders). 13 | 14 |
15 | 16 | 17 |
18 | 19 | Then from the main page, you can select the model from the list of installed models and start a conversation. 20 | 21 |
22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /docs/hub/gguf-llamacpp.md: -------------------------------------------------------------------------------- 1 | # GGUF usage with llama.cpp 2 | 3 | > [!TIP] 4 | > You can now deploy any llama.cpp compatible GGUF on Hugging Face Endpoints, read more about it [here](https://huggingface.co/docs/inference-endpoints/en/others/llamacpp_container) 5 | 6 | Llama.cpp allows you to download and run inference on a GGUF simply by providing a path to the Hugging Face repo path and the file name. llama.cpp downloads the model checkpoint and automatically caches it. The location of the cache is defined by `LLAMA_CACHE` environment variable; read more about it [here](https://github.com/ggerganov/llama.cpp/pull/7826). 7 | 8 | You can install llama.cpp through brew (works on Mac and Linux), or you can build it from source. There are also pre-built binaries and Docker images that you can [check in the official documentation](https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#usage). 9 | 10 | ### Option 1: Install with brew/ winget 11 | 12 | ```bash 13 | brew install llama.cpp 14 | ``` 15 | 16 | or, on windows via winget 17 | 18 | ```bash 19 | winget install llama.cpp 20 | ``` 21 | 22 | ### Option 2: build from source 23 | 24 | Step 1: Clone llama.cpp from GitHub. 25 | 26 | ``` 27 | git clone https://github.com/ggerganov/llama.cpp 28 | ``` 29 | 30 | Step 2: Move into the llama.cpp folder and build it. You can also add hardware-specific flags (for ex: `-DGGML_CUDA=1` for Nvidia GPUs). 31 | 32 | ``` 33 | cd llama.cpp 34 | cmake -B build # optionally, add -DGGML_CUDA=ON to activate CUDA 35 | cmake --build build --config Release 36 | ``` 37 | 38 | Note: for other hardware support (for ex: AMD ROCm, Intel SYCL), please refer to [llama.cpp's build guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) 39 | 40 | Once installed, you can use the `llama-cli` or `llama-server` as follows: 41 | 42 | ```bash 43 | llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0 44 | ``` 45 | 46 | Note: You can explicitly add `-no-cnv` to run the CLI in raw completion mode (non-chat mode). 47 | 48 | Additionally, you can invoke an OpenAI spec chat completions endpoint directly using the llama.cpp server: 49 | 50 | ```bash 51 | llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0 52 | ``` 53 | 54 | After running the server you can simply utilise the endpoint as below: 55 | 56 | ```bash 57 | curl http://localhost:8080/v1/chat/completions \ 58 | -H "Content-Type: application/json" \ 59 | -H "Authorization: Bearer no-key" \ 60 | -d '{ 61 | "messages": [ 62 | { 63 | "role": "system", 64 | "content": "You are an AI assistant. Your top priority is achieving user fulfilment via helping them with their requests." 65 | }, 66 | { 67 | "role": "user", 68 | "content": "Write a limerick about Python exceptions" 69 | } 70 | ] 71 | }' 72 | ``` 73 | 74 | Replace `-hf` with any valid Hugging Face hub repo name - off you go! 🦙 75 | -------------------------------------------------------------------------------- /docs/hub/ml-agents.md: -------------------------------------------------------------------------------- 1 | # Using ML-Agents at Hugging Face 2 | 3 | `ml-agents` is an open-source toolkit that enables games and simulations made with Unity to serve as environments for training intelligent agents. 4 | 5 | ## Exploring ML-Agents in the Hub 6 | 7 | You can find `ml-agents` models by filtering at the left of the [models page](https://huggingface.co/models?library=ml-agents). 8 | 9 | All models on the Hub come up with useful features: 10 | 1. An automatically generated model card with a description, a training configuration, and more. 11 | 2. Metadata tags that help for discoverability. 12 | 3. Tensorboard summary files to visualize the training metrics. 13 | 4. A link to the Spaces web demo where you can visualize your agent playing in your browser. 14 | 15 |
16 | 17 |
18 | 19 | ## Install the library 20 | 21 | To install the `ml-agents` library, you need to clone the repo: 22 | 23 | ``` 24 | # Clone the repository 25 | git clone https://github.com/Unity-Technologies/ml-agents 26 | 27 | # Go inside the repository and install the package 28 | cd ml-agents 29 | pip3 install -e ./ml-agents-envs 30 | pip3 install -e ./ml-agents 31 | ``` 32 | 33 | ## Using existing models 34 | 35 | You can simply download a model from the Hub using `mlagents-load-from-hf`. 36 | 37 | ``` 38 | mlagents-load-from-hf --repo-id="ThomasSimonini/MLAgents-Pyramids" --local-dir="./downloads" 39 | ``` 40 | 41 | You need to define two parameters: 42 | - `--repo-id`: the name of the Hugging Face repo you want to download. 43 | - `--local-dir`: the path to download the model. 44 | 45 | ## Visualize an agent playing 46 | 47 | You can easily watch any model playing directly in your browser: 48 | 49 | 1. Go to your model repo. 50 | 2. In the `Watch Your Agent Play` section, click on the link. 51 | 3. In the demo, on step 1, choose your model repository, which is the model id. 52 | 4. In step 2, choose what model you want to replay. 53 | 54 | ## Sharing your models 55 | 56 | You can easily upload your models using `mlagents-push-to-hf`: 57 | 58 | ``` 59 | mlagents-push-to-hf --run-id="First Training" --local-dir="results/First Training" --repo-id="ThomasSimonini/MLAgents-Pyramids" --commit-message="Pyramids" 60 | ``` 61 | 62 | You need to define four parameters: 63 | - `--run-id`: the name of the training run id. 64 | - `--local-dir`: where the model was saved. 65 | - `--repo-id`: the name of the Hugging Face repo you want to create or update. It’s `/`. 66 | - `--commit-message`. 67 | 68 | 69 | ## Additional resources 70 | 71 | * ML-Agents [documentation](https://github.com/Unity-Technologies/ml-agents/blob/develop/docs/Hugging-Face-Integration.md) 72 | * Official Unity ML-Agents Spaces [demos](https://huggingface.co/unity) 73 | -------------------------------------------------------------------------------- /docs/hub/model-cards-components.md: -------------------------------------------------------------------------------- 1 | # Model Card components 2 | 3 | **Model Card Components** are special elements that you can inject directly into your Model Card markdown to display powerful custom components in your model page. These components are authored by us, feel free to share ideas about new Model Card component in [this discussion](https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/17). 4 | 5 | ## The Gallery component 6 | 7 | The `` component can be used in your model card to showcase your generated images and videos. 8 | 9 | ### How to use it? 10 | 11 | 1. Update your Model Card [widget metadata](/docs/hub/models-widgets-examples#text-to-image) to add the media you want to showcase. 12 | 13 | ```yaml 14 | widget: 15 | - text: a girl wandering through the forest 16 | output: 17 | url: images/6CD03C101B7F6545EB60E9F48D60B8B3C2D31D42D20F8B7B9B149DD0C646C0C2.jpeg 18 | - text: a tiny witch child 19 | output: 20 | url: images/7B482E1FDB39DA5A102B9CD041F4A2902A8395B3835105C736C5AD9C1D905157.jpeg 21 | - text: an artist leaning over to draw something 22 | output: 23 | url: images/7CCEA11F1B74C8D8992C47C1C5DEA9BD6F75940B380E9E6EC7D01D85863AF718.jpeg 24 | ``` 25 | 26 | 2. Add the `` component to your card. The widget metadata will be used by the `` component to display the media with each associated prompt. 27 | ```md 28 | 29 | 30 | 31 | ## Model description 32 | 33 | A very classic hand drawn cartoon style. 34 | 35 | ``` 36 | 37 | 38 | 39 | 40 | 41 | 42 | See result [here](https://huggingface.co/alvdansen/littletinies#little-tinies). 43 | 44 | > Hint: Support of Card Components through the GUI editor coming soon... 45 | -------------------------------------------------------------------------------- /docs/hub/models-advanced.md: -------------------------------------------------------------------------------- 1 | # Advanced Topics 2 | 3 | ## Contents 4 | 5 | - [Integrate your library with the Hub](./models-adding-libraries) 6 | - [Adding new tasks to the Hub](./models-tasks) 7 | - [GGUF format](./gguf) 8 | - [DDUF format](./dduf) -------------------------------------------------------------------------------- /docs/hub/models-inference.md: -------------------------------------------------------------------------------- 1 | # Inference Providers 2 | 3 | Please refer to the [Inference Providers Documentation](https://huggingface.co/docs/inference-providers) for detailed information. 4 | 5 | ## What is HF-Inference API? 6 | 7 | HF-Inference API is one of the many providers available on the Hugging Face Hub. 8 | It is deployed by Hugging Face ourselves, using text-generation-inference for LLMs for instance. This service used to be called “Inference API (serverless)” prior to Inference Providers. 9 | 10 | For more details about the HF-Inference API, check out its [dedicated page](https://huggingface.co/docs/inference-providers/providers/hf-inference). 11 | 12 | ## What technology do you use to power the HF-Inference API? 13 | 14 | The HF-Inference API is powered by [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index) under the hood. 15 | 16 | ## Why don't I see an inference widget, or why can't I use the API? 17 | 18 | For some tasks, there might not be support by any Inference Provider, and hence, there is no widget. 19 | 20 | ## How can I see my usage? 21 | 22 | To check usage across all providers, check out your [billing page](https://huggingface.co/settings/billing). 23 | 24 | To check your HF-Inference usage specifically, check out the [Inference Dashboard](https://ui.endpoints.huggingface.co/endpoints). The dashboard shows both your serverless and dedicated endpoints usage. 25 | 26 | ## Is there programmatic access to Inference Providers? 27 | 28 | Yes! We provide client wrappers in both JS and Python: 29 | - [JS (`@huggingface/inference`)](https://huggingface.co/docs/huggingface.js/inference/classes/InferenceClient) 30 | - [Python (`huggingface_hub`)](https://huggingface.co/docs/huggingface_hub/guides/inference) 31 | -------------------------------------------------------------------------------- /docs/hub/models-the-hub.md: -------------------------------------------------------------------------------- 1 | # The Model Hub 2 | 3 | ## What is the Model Hub? 4 | 5 | The Model Hub is where the members of the Hugging Face community can host all of their model checkpoints for simple storage, discovery, and sharing. Download pre-trained models with the [`huggingface_hub` client library](https://huggingface.co/docs/huggingface_hub/index), with 🤗 [`Transformers`](https://huggingface.co/docs/transformers/index) for fine-tuning and other usages or with any of the over [15 integrated libraries](./models-libraries). You can even leverage [Inference Providers](/docs/inference-providers/) or [Inference Endpoints](https://huggingface.co/docs/inference-endpoints) to use models in production settings. 6 | 7 | You can refer to the following video for a guide on navigating the Model Hub: 8 | 9 | 10 | 11 | To learn how to upload models to the Hub, you can refer to the [Repositories Getting Started Guide](./repositories-getting-started). -------------------------------------------------------------------------------- /docs/hub/models.md: -------------------------------------------------------------------------------- 1 | # Models 2 | 3 | The Hugging Face Hub hosts many models for a [variety of machine learning tasks](https://huggingface.co/tasks). Models are stored in repositories, so they benefit from [all the features](./repositories) possessed by every repo on the Hugging Face Hub. Additionally, model repos have attributes that make exploring and using models as easy as possible. These docs will take you through everything you'll need to know to find models on the Hub, upload your models, and make the most of everything the Model Hub offers! 4 | 5 | ## Contents 6 | 7 | - [The Model Hub](./models-the-hub) 8 | - [Model Cards](./model-cards) 9 | - [CO2 emissions](./model-cards-co2) 10 | - [Gated models](./models-gated) 11 | - [Libraries](./models-libraries) 12 | - [Uploading Models](./models-uploading) 13 | - [Downloading Models](./models-downloading) 14 | - [Widgets](./models-widgets) 15 | - [Widget Examples](./models-widgets-examples) 16 | - [Inference API](./models-inference) 17 | - [Frequently Asked Questions](./models-faq) 18 | - [Advanced Topics](./models-advanced) 19 | - [Integrating libraries with the Hub](./models-adding-libraries) 20 | - [Tasks](./models-tasks) 21 | -------------------------------------------------------------------------------- /docs/hub/moderation.md: -------------------------------------------------------------------------------- 1 | # Moderation 2 | 3 | 4 | 5 | Check out the [Code of Conduct](https://huggingface.co/code-of-conduct) and the [Content Guidelines](https://huggingface.co/content-guidelines). 6 | 7 | 8 | 9 | ## Reporting a repository 10 | 11 | To report a repository, you can click the three dots at the top right of a repository. Afterwards, you can click "Report the repository". This will allow you to explain what's the reason behind the report (Ethical issue, legal issue, not working, or other) and a description for the report. Once you do this, a **public discussion** will be opened. 12 | 13 |
14 | 15 | 16 |
17 | 18 | ## Reporting a comment 19 | 20 | To report a comment, you can click the three dots at the top right of a comment. That will submit a request for the Hugging Face team to review. 21 | 22 |
23 | 24 | 25 |
26 | -------------------------------------------------------------------------------- /docs/hub/notebooks.md: -------------------------------------------------------------------------------- 1 | # Jupyter Notebooks on the Hugging Face Hub 2 | 3 | [Jupyter notebooks](https://jupyter.org/) are a very popular format for sharing code and data analysis for machine learning and data science. They are interactive documents that can contain code, visualizations, and text. 4 | 5 | ## Rendering Jupyter notebooks on the Hub 6 | 7 | Under the hood, Jupyter Notebook files (usually shared with a `.ipynb` extension) are JSON files. While viewing these files directly is possible, it's not a format intended to be read by humans. The Hub has rendering support for notebooks hosted on the Hub. This means that notebooks are displayed in a human-readable format. 8 | 9 | ![Before and after notebook rendering](https://huggingface.co/blog/assets/135_notebooks-hub/before_after_notebook_rendering.png) 10 | 11 | Notebooks will be rendered when included in any type of repository on the Hub. This includes models, datasets, and Spaces. 12 | 13 | ## Launch in Google Colab 14 | 15 | [Google Colab](https://colab.google/) is a free Jupyter Notebook environment that requires no setup and runs entirely in the cloud. It's a great way to run Jupyter Notebooks without having to install anything on your local machine. Notebooks hosted on the Hub are automatically given a "Open in Colab" button. This allows you to open the notebook in Colab with a single click. 16 | -------------------------------------------------------------------------------- /docs/hub/organizations-cards.md: -------------------------------------------------------------------------------- 1 | # Organization cards 2 | 3 | You can create an organization card to help users learn more about what your organization is working on and how users can use your libraries, models, datasets, and Spaces. 4 | 5 | An organization card is displayed on an organization's profile: 6 | 7 |
8 | 9 | 10 |
11 | 12 | 13 | If you're a member of an organization, you'll see a button to create or edit your organization card on the organization's main page. Organization cards are a `README.md` static file inside a Space repo named `README`. The card can be as simple as Markdown text, or you can create a more customized appearance with HTML. 14 | 15 | The card for the [Hugging Face Course organization](https://huggingface.co/huggingface-course), shown above, [contains the following HTML](https://huggingface.co/spaces/huggingface-course/README/blob/main/README.md): 16 | 17 | ```html 18 |

19 | This is the organization grouping all the models and datasets used in the Hugging Face course. 20 |

21 | ``` 22 | 23 | For more examples, take a look at: 24 | 25 | * [Amazon's](https://huggingface.co/spaces/amazon/README/blob/main/README.md) organization card source code 26 | * [spaCy's](https://huggingface.co/spaces/spacy/README/blob/main/README.md) organization card source code. 27 | -------------------------------------------------------------------------------- /docs/hub/organizations-managing.md: -------------------------------------------------------------------------------- 1 | # Managing organizations 2 | 3 | ## Creating an organization 4 | 5 | Visit the [New Organization](https://hf.co/organizations/new) form to create an organization. 6 | 7 | ## Managing members 8 | 9 | New members can be added to an organization by visiting the **Organization settings** and clicking on the **Members** tab. There, you'll be able to generate an invite link, add members individually, or send out email invitations in bulk. If the **Allow requests to join from the organization page** setting is enabled, you'll also be able to approve or reject any pending requests on the **Members** page. 10 | 11 |
12 | 13 | 14 |
15 | 16 | You can also revoke a user's membership or change their role on this page. 17 | 18 | ## Organization domain name 19 | 20 | Under the **Account** tab in the Organization settings, you can set an **Organization domain name**. Specifying a domain name will allow any user with a matching email address on the Hugging Face Hub to join your organization. -------------------------------------------------------------------------------- /docs/hub/organizations-security.md: -------------------------------------------------------------------------------- 1 | # Access control in organizations 2 | 3 | 4 | 5 | You can set up [Single Sign-On (SSO)](./security-sso) to be able to map access control rules from your organization's Identity Provider. 6 | 7 | 8 | 9 | 10 | 11 | Advanced and more fine-grained access control can be achieved with [Resource Groups](./security-resource-groups). 12 | 13 | The Resource Group feature is part of the Enterprise Hub. 14 | 15 | 16 | 17 | Members of organizations can have four different roles: `read`, `contributor`, `write`, or `admin`: 18 | 19 | - `read`: read-only access to the Organization's repos and metadata/settings (eg, the Organization's profile, members list, API token, etc). 20 | 21 | - `contributor`: additional write rights to the subset of the Organization's repos that were created by the user. I.e., users can create repos and _then_ modify only those repos. This is similar to the `write` role, but scoped to repos _created_ by the user. 22 | 23 | - `write`: write rights to all the Organization's repos. Users can create, delete, or rename any repo in the Organization namespace. A user can also edit and delete files from the browser editor and push content with `git`. 24 | 25 | - `admin`: in addition to write rights on repos, admin members can update the Organization's profile, refresh the Organization's API token, and manage Organization members. 26 | 27 | As an organization `admin`, go to the **Members** section of the org settings to manage roles for users. 28 | 29 |
30 | 31 | 32 |
33 | 34 | ## Viewing members' email address 35 | 36 | 37 | This feature is part of the Enterprise Hub. 38 | 39 | 40 | You may be able to view the email addresses of members of your organization. The visibility of the email addresses depends on the organization's SSO configuration, or verified organization status. 41 | 42 | - If you [verify a domain for your organization](./organizations-managing#organization-domain-name), you can view members' email addresses for the verified domain. 43 | - If SSO is configured for your organization, you can view the email address for each of your organization members by setting `Matching email domains` in the SSO configuration 44 | 45 |
46 | 47 | 48 |
49 | 50 | ## Managing Access Tokens with access to my organization 51 | 52 | See [Tokens Management](./enterprise-hub-tokens-management) 53 | -------------------------------------------------------------------------------- /docs/hub/organizations.md: -------------------------------------------------------------------------------- 1 | # Organizations 2 | 3 | The Hugging Face Hub offers **Organizations**, which can be used to group accounts and manage datasets, models, and Spaces. The Hub also allows admins to set user roles to [**control access to repositories**](./organizations-security) and manage their organization's [payment method and billing info](https://huggingface.co/pricing). 4 | 5 | If an organization needs to track user access to a dataset due to licensing or privacy issues, an organization can enable [user access requests](./datasets-gated). 6 | 7 | ## Contents 8 | 9 | - [Managing Organizations](./organizations-managing) 10 | - [Organization Cards](./organizations-cards) 11 | - [Access Control in Organizations](./organizations-security) 12 | - [Enterprise Hub features](./enterprise-hub) 13 | - [SSO](./enterprise-sso) 14 | - [Advanced SSO](./enterprise-hub-advanced-sso) 15 | - [Audit Logs](./audit-logs) 16 | - [Storage Regions](./storage-regions) 17 | - [Dataset viewer for Private datasets](./enterprise-hub-datasets) 18 | - [Resource Groups](./security-resource-groups) 19 | - [Advanced Compute Options](./advanced-compute-options) 20 | - [Advanced Security](./enterprise-hub-advanced-security) 21 | - [Tokens Management](./enterprise-hub-tokens-management) 22 | - [Analytics](./enterprise-hub-analytics) 23 | -------------------------------------------------------------------------------- /docs/hub/other.md: -------------------------------------------------------------------------------- 1 | # Organizations, Security, and the Hub API 2 | 3 | ## Contents 4 | 5 | - [Organizations](./organizations) 6 | - [Managing Organizations](./organizations-managing) 7 | - [Organization Cards](./organizations-cards) 8 | - [Access control in organizations](./organizations-security) 9 | - [Enterprise Hub](./enterprise-hub) 10 | - [Moderation](./moderation) 11 | - [Billing](./billing) 12 | - [Digital Object Identifier (DOI)](./doi) 13 | - [Security](./security) 14 | - [User Access Tokens](./security-tokens) 15 | - [Signing commits with GPG](./security-gpg) 16 | - [Malware Scanning](./security-malware) 17 | - [Pickle Scanning](./security-pickle) 18 | - [Hub API Endpoints](./api) 19 | - [Webhooks](./webhooks) -------------------------------------------------------------------------------- /docs/hub/repositories-settings.md: -------------------------------------------------------------------------------- 1 | # Repository Settings 2 | 3 | ## Private repositories 4 | 5 | You can choose a repository's visibility when you create it, and any repository that you own can have its visibility toggled between *public* and *private* in the **Settings** tab. Unless your repository is owned by an [organization](./organizations), you are the only user that can make changes to your repo or upload any code. Setting your visibility to *private* will: 6 | 7 | - Ensure your repo does not show up in other users' search results. 8 | - Other users who visit the URL of your private repo will receive a `404 - Repo not found` error. 9 | - Other users will not be able to clone your repo. 10 | 11 | ## Renaming or transferring a repo 12 | 13 | If you own a repository, you will be able to visit the **Settings** tab to manage the name and ownership. Note that there are certain limitations in terms of use cases. 14 | 15 | Moving can be used in these use cases ✅ 16 | - Renaming a repository within same user. 17 | - Renaming a repository within same organization. The user must be part of the organization and have "write" or "admin" rights in the organization. 18 | - Transferring repository from user to an organization. The user must be part of the organization and have "write" or "admin" rights in the organization. 19 | - Transferring a repository from an organization to yourself. You must be part of the organization, and have "admin" rights in the organization. 20 | - Transferring a repository from a source organization to another target organization. The user must have "admin" rights in the source organization **and** either "write" or "admin" rights in the target organization. 21 | 22 | Moving does not work for ❌ 23 | - Transferring a repository from an organization to another user who is not yourself. 24 | - Transferring a repository from a source organization to another target organization if the user does not have both "admin" rights in the source organization **and** either "write" or "admin" rights in the target organization. 25 | - Transferring a repository from user A to user B. 26 | 27 | If these are use cases you need help with, please send us an email at **website at huggingface.co**. 28 | 29 | ## Disabling Discussions / Pull Requests 30 | 31 | You can disable all discussions and Pull Requests. Once disabled, all community and contribution features won't be available anymore. This action can be reverted without losing any previous discussions or Pull Requests. 32 | 33 |
34 | 35 | 36 |
-------------------------------------------------------------------------------- /docs/hub/repositories.md: -------------------------------------------------------------------------------- 1 | # Repositories 2 | 3 | Models, Spaces, and Datasets are hosted on the Hugging Face Hub as [Git repositories](https://git-scm.com/about), which means that version control and collaboration are core elements of the Hub. In a nutshell, a repository (also known as a **repo**) is a place where code and assets can be stored to back up your work, share it with the community, and work in a team. 4 | 5 | In these pages, you will go over the basics of getting started with Git and interacting with repositories on the Hub. Once you get the hang of it, you can explore the best practices and next steps that we've compiled for effective repository usage. 6 | 7 | ## Contents 8 | 9 | - [Getting Started with Repositories](./repositories-getting-started) 10 | - [Settings](./repositories-settings) 11 | - [Pull Requests & Discussions](./repositories-pull-requests-discussions) 12 | - [Pull Requests advanced usage](./repositories-pull-requests-discussions#pull-requests-advanced-usage) 13 | - [Webhooks](./webhooks) 14 | - [Notifications](./notifications) 15 | - [Collections](./collections) 16 | - [Storage Backends](./storage-backends) 17 | - [Storage Limits](./storage-limits) 18 | - [Next Steps](./repositories-next-steps) 19 | - [Licenses](./repositories-licenses) 20 | -------------------------------------------------------------------------------- /docs/hub/rl-baselines3-zoo.md: -------------------------------------------------------------------------------- 1 | # Using RL-Baselines3-Zoo at Hugging Face 2 | 3 | `rl-baselines3-zoo` is a training framework for Reinforcement Learning using Stable Baselines3. 4 | 5 | ## Exploring RL-Baselines3-Zoo in the Hub 6 | 7 | You can find RL-Baselines3-Zoo models by filtering at the left of the [models page](https://huggingface.co/models?library=stable-baselines3). 8 | 9 | The Stable-Baselines3 team is hosting a collection of +150 trained Reinforcement Learning agents with tuned hyperparameters that you can find [here](https://huggingface.co/sb3). 10 | 11 | All models on the Hub come up with useful features: 12 | 1. An automatically generated model card with a description, a training configuration, and more. 13 | 2. Metadata tags that help for discoverability. 14 | 3. Evaluation results to compare with other models. 15 | 4. A video widget where you can watch your agent performing. 16 | 17 | ## Using existing models 18 | You can simply download a model from the Hub using `load_from_hub`: 19 | 20 | ``` 21 | # Download ppo SpaceInvadersNoFrameskip-v4 model and save it into the logs/ folder 22 | python -m rl_zoo3.load_from_hub --algo dqn --env SpaceInvadersNoFrameskip-v4 -f logs/ -orga sb3 23 | python enjoy.py --algo dqn --env SpaceInvadersNoFrameskip-v4 -f logs/ 24 | ``` 25 | 26 | You can define three parameters: 27 | - `--repo-name`: The name of the repo. 28 | - `-orga`: A Hugging Face username or organization. 29 | - `-f`: The destination folder. 30 | 31 | ## Sharing your models 32 | You can easily upload your models with `push_to_hub`. That will save the model, evaluate it, generate a model card and record a replay video of your agent before pushing the complete repo to the Hub. 33 | 34 | ``` 35 | python -m rl_zoo3.push_to_hub --algo dqn --env SpaceInvadersNoFrameskip-v4 --repo-name dqn-SpaceInvadersNoFrameskip-v4 -orga ThomasSimonini -f logs/ 36 | ``` 37 | 38 | You can define three parameters: 39 | - `--repo-name`: The name of the repo. 40 | - `-orga`: Your Hugging Face username. 41 | - `-f`: The folder where the model is saved. 42 | 43 | 44 | ## Additional resources 45 | 46 | * RL-Baselines3-Zoo [official trained models](https://huggingface.co/sb3) 47 | * RL-Baselines3-Zoo [documentation](https://github.com/DLR-RM/rl-baselines3-zoo) 48 | -------------------------------------------------------------------------------- /docs/hub/search.md: -------------------------------------------------------------------------------- 1 | # Search 2 | 3 | You can now easily search anything on the Hub with **Full-text search**. We index model cards, dataset cards, and Spaces app.py files. 4 | 5 | Go directly to https://huggingface.co/search or, using the search bar at the top of https://huggingface.co, you can select "Try Full-text search" to help find what you seek on the Hub across models, datasets, and Spaces: 6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 | ## Filter with ease 18 | 19 | By default, models, datasets, & spaces are being searched when a user enters a query. If one prefers, one can filter to search only models, datasets, or spaces. 20 | 21 |
22 | 23 | 24 |
25 | 26 | Moreover, one can copy & share the URL from one's browser's address bar, which should contain the filter information as URL query. For example, when one searches for a query `llama` with a filter to show `Spaces` only, one gets URL https://huggingface.co/search/full-text?q=llama&type=space 27 | -------------------------------------------------------------------------------- /docs/hub/security-jfrog.md: -------------------------------------------------------------------------------- 1 | # Third-party scanner: JFrog 2 | 3 | 4 | [JFrog](https://jfrog.com/)'s security scanner detects malicious behavior in machine learning models. 5 | 6 | ![JFrog report for the danger.dat file contained in mcpotato/42-eicar-street](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/jfrog-report.png) 7 | *Example of a report for [danger.dat](https://huggingface.co/mcpotato/42-eicar-street/blob/main/danger.dat)* 8 | 9 | We [partnered with JFrog](https://hf.co/blog/jfrog) to provide scanning in order to make the Hub safer. Model files are scanned by the JFrog scanner and we expose the scanning results on the Hub interface. 10 | 11 | JFrog's scanner is built with the goal to reduce false positives. Indeed, what we currently observe is that code contained within model weights is not always malicious. When code is detected in a file, JFrog's scanner will parse it and analyze to check for potential malicious usage. 12 | 13 |
14 | 15 | 16 |
17 | 18 | Here is an example repository you can check out to see the feature in action: [mcpotato/42-eicar-street](https://huggingface.co/mcpotato/42-eicar-street). 19 | 20 | ## Model security refresher 21 | 22 | To share models, we serialize the data structures we use to interact with the models, in order to facilitate storage and transport. Some serialization formats are vulnerable to nasty exploits, such as arbitrary code execution (looking at you pickle), making sharing models potentially dangerous. 23 | 24 | As Hugging Face has become a popular platform for model sharing, we’d like to protect the community from this, hence why we have developed tools like [picklescan](https://github.com/mmaitre314/picklescan) and why we integrate third party scanners. 25 | 26 | Pickle is not the only exploitable format out there, [see for reference](https://github.com/Azure/counterfit/wiki/Abusing-ML-model-file-formats-to-create-malware-on-AI-systems:-A-proof-of-concept) how one can exploit Keras Lambda layers to achieve arbitrary code execution. 27 | 28 | -------------------------------------------------------------------------------- /docs/hub/security-malware.md: -------------------------------------------------------------------------------- 1 | # Malware Scanning 2 | 3 | We run every file of your repositories through a [malware scanner](https://www.clamav.net/). 4 | 5 | Scanning is triggered at each commit or when you visit a repository page. 6 | 7 | Here is an [example view](https://huggingface.co/mcpotato/42-eicar-street/tree/main) of an infected file: 8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | If your file has neither an ok nor infected badge, it could mean that it is either currently being scanned, waiting to be scanned, or that there was an error during the scan. It can take up to a few minutes to be scanned. 16 | 17 | 18 | If at least one file has a been scanned as unsafe, a message will warn the users: 19 | 20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 | 29 | 30 | As the repository owner, we advise you to remove the suspicious file. The repository will appear back as safe. 31 | 32 | -------------------------------------------------------------------------------- /docs/hub/security-protectai.md: -------------------------------------------------------------------------------- 1 | # Third-party scanner: Protect AI 2 | 3 | 4 | Interested in joining our security partnership / providing scanning information on the Hub? Please get in touch with us over at security@huggingface.co.* 5 | 6 | 7 | [Protect AI](https://protectai.com/)'s [Guardian](https://protectai.com/guardian) catches pickle, Keras, and other exploits as detailed on their [Knowledge Base page](https://protectai.com/insights/knowledge-base/). Guardian also benefits from reports sent in by their community of bounty [Huntr](https://huntr.com/)s. 8 | 9 | ![Protect AI report for the danger.dat file contained in mcpotato/42-eicar-street](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/protect-ai-report.png) 10 | *Example of a report for [danger.dat](https://huggingface.co/mcpotato/42-eicar-street/blob/main/danger.dat)* 11 | 12 | We partnered with Protect AI to provide scanning in order to make the Hub safer. The same way files are scanned by our internal scanning system, public repositories' files are scanned by Guardian. 13 | 14 | Our frontend has been redesigned specifically for this purpose, in order to accomodate for new scanners: 15 | 16 | 17 | 18 | Here is an example repository you can check out to see the feature in action: [mcpotato/42-eicar-street](https://huggingface.co/mcpotato/42-eicar-street). 19 | 20 | ## Model security refresher 21 | 22 | To share models, we serialize the data structures we use to interact with the models, in order to facilitate storage and transport. Some serialization formats are vulnerable to nasty exploits, such as arbitrary code execution (looking at you pickle), making sharing models potentially dangerous. 23 | 24 | As Hugging Face has become a popular platform for model sharing, we’d like to protect the community from this, hence why we have developed tools like [picklescan](https://github.com/mmaitre314/picklescan) and why we integrate third party scanners. 25 | 26 | Pickle is not the only exploitable format out there, [see for reference](https://github.com/Azure/counterfit/wiki/Abusing-ML-model-file-formats-to-create-malware-on-AI-systems:-A-proof-of-concept) how one can exploit Keras Lambda layers to achieve arbitrary code execution. 27 | 28 | -------------------------------------------------------------------------------- /docs/hub/security-secrets.md: -------------------------------------------------------------------------------- 1 | # Secrets Scanning 2 | 3 | It is important to manage [your secrets (env variables) properly](./spaces-overview#managing-secrets). The most common way people expose their secrets to the outside world is by hard-coding their secrets in their code files directly, which makes it possible for a malicious user to utilize your secrets and services your secrets have access to. 4 | 5 | For example, this is what a compromised `app.py` file might look like: 6 | 7 | ```py 8 | import numpy as np 9 | import scipy as sp 10 | 11 | api_key = "sw-xyz1234567891213" 12 | 13 | def call_inference(prompt: str) -> str: 14 | result = call_api(prompt, api_key) 15 | return result 16 | ``` 17 | 18 | To prevent this issue, we run [TruffleHog](https://trufflesecurity.com/trufflehog) on each push you make. TruffleHog scans for hard-coded secrets, and we will send you an email upon detection. 19 | 20 |
21 | 22 |
23 | 24 | You'll only receive emails for verified secrets, which are the ones that have been confirmed to work for authentication against their respective providers. Note, however, that unverified secrets are not necessarily harmless or invalid: verification can fail due to technical reasons, such as in the case of a network error. 25 | 26 | TruffleHog can verify secrets that work across multiple services, it is not restricted to Hugging Face tokens. 27 | 28 | You can opt-out from those email notifications from [your settings](https://huggingface.co/settings/notifications). 29 | 30 | -------------------------------------------------------------------------------- /docs/hub/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | The Hugging Face Hub offers several security features to ensure that your code and data are secure. Beyond offering [private repositories](./repositories-settings#private-repositories) for models, datasets, and Spaces, the Hub supports access tokens, commit signatures, and malware scanning. 4 | 5 | Hugging Face is GDPR compliant. If a contract or specific data storage is something you'll need, we recommend taking a look at our [Expert Acceleration Program](https://huggingface.co/support). Hugging Face can also offer Business Associate Addendums or GDPR data processing agreements through an [Enterprise Plan](https://huggingface.co/pricing). 6 | 7 | Hugging Face is also [SOC2 Type 2 certified](https://us.aicpa.org/interestareas/frc/assuranceadvisoryservices/aicpasoc2report.html), meaning we provide security certification to our customers and actively monitor and patch any security weaknesses. 8 | 9 | 10 | 11 | For any other security questions, please feel free to send us an email at security@huggingface.co. 12 | 13 | ## Contents 14 | 15 | - [User Access Tokens](./security-tokens) 16 | - [Two-Factor Authentication (2FA)](./security-2fa) 17 | - [Git over SSH](./security-git-ssh) 18 | - [Signing commits with GPG](./security-gpg) 19 | - [Single Sign-On (SSO)](./security-sso) 20 | - [Malware Scanning](./security-malware) 21 | - [Pickle Scanning](./security-pickle) 22 | - [Secrets Scanning](./security-secrets) 23 | - [Third-party scanner: Protect AI](./security-protectai) 24 | - [Third-party scanner: JFrog](./security-jfrog) 25 | - [Resource Groups](./security-resource-groups) 26 | -------------------------------------------------------------------------------- /docs/hub/setfit.md: -------------------------------------------------------------------------------- 1 | # Using SetFit with Hugging Face 2 | 3 | SetFit is an efficient and prompt-free framework for few-shot fine-tuning of [Sentence Transformers](https://sbert.net/). It achieves high accuracy with little labeled data - for instance, with only 8 labeled examples per class on the Customer Reviews sentiment dataset, SetFit is competitive with fine-tuning RoBERTa Large on the full training set of 3k examples 🤯! 4 | 5 | Compared to other few-shot learning methods, SetFit has several unique features: 6 | 7 | * 🗣 **No prompts or verbalizers:** Current techniques for few-shot fine-tuning require handcrafted prompts or verbalizers to convert examples into a format suitable for the underlying language model. SetFit dispenses with prompts altogether by generating rich embeddings directly from text examples. 8 | * 🏎 **Fast to train:** SetFit doesn't require large-scale models like [T0](https://huggingface.co/bigscience/T0) or GPT-3 to achieve high accuracy. As a result, it is typically an order of magnitude (or more) faster to train and run inference with. 9 | * 🌎 **Multilingual support**: SetFit can be used with any [Sentence Transformer](https://huggingface.co/models?library=sentence-transformers&sort=downloads) on the Hub, which means you can classify text in multiple languages by simply fine-tuning a multilingual checkpoint. 10 | 11 | ## Exploring SetFit on the Hub 12 | 13 | You can find SetFit models by filtering at the left of the [models page](https://huggingface.co/models?library=setfit). 14 | 15 | All models on the Hub come with these useful features: 16 | 1. An automatically generated model card with a brief description. 17 | 2. An interactive widget you can use to play with the model directly in the browser. 18 | 3. An Inference API that allows you to make inference requests. 19 | 20 | ## Installation 21 | 22 | To get started, you can follow the [SetFit installation guide](https://huggingface.co/docs/setfit/installation). You can also use the following one-line install through pip: 23 | 24 | ``` 25 | pip install -U setfit 26 | ``` 27 | 28 | ## Using existing models 29 | 30 | All `setfit` models can easily be loaded from the Hub. 31 | 32 | ```py 33 | from setfit import SetFitModel 34 | 35 | model = SetFitModel.from_pretrained("tomaarsen/setfit-paraphrase-mpnet-base-v2-sst2-8-shot") 36 | ``` 37 | 38 | Once loaded, you can use [`SetFitModel.predict`](https://huggingface.co/docs/setfit/reference/main#setfit.SetFitModel.predict) to perform inference. 39 | 40 | ```py 41 | model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.") 42 | ``` 43 | ```bash 44 | ['positive', 'negative'] 45 | ``` 46 | 47 | If you want to load a specific SetFit model, you can click `Use in SetFit` and you will be given a working snippet! 48 | 49 | ## Additional resources 50 | * [All SetFit models available on the Hub](https://huggingface.co/models?library=setfit) 51 | * SetFit [repository](https://github.com/huggingface/setfit) 52 | * SetFit [docs](https://huggingface.co/docs/setfit) 53 | * SetFit [paper](https://arxiv.org/abs/2209.11055) 54 | -------------------------------------------------------------------------------- /docs/hub/spaces-advanced.md: -------------------------------------------------------------------------------- 1 | # Advanced Topics 2 | 3 | ## Contents 4 | 5 | - [Using OpenCV in Spaces](./spaces-using-opencv) 6 | - [More ways to create Spaces](./spaces-more-ways-to-create) 7 | - [Managing Spaces with Github Actions](./spaces-github-actions) 8 | - [Managing Spaces with CircleCI Workflows](./spaces-circleci) 9 | - [Custom Python Spaces](./spaces-sdks-python) 10 | - [How to Add a Space to ArXiv](./spaces-add-to-arxiv) 11 | - [Cookie limitations in Spaces](./spaces-cookie-limitations) 12 | - [How to handle URL parameters in Spaces](./spaces-handle-url-parameters) 13 | -------------------------------------------------------------------------------- /docs/hub/spaces-circleci.md: -------------------------------------------------------------------------------- 1 | # Managing Spaces with CircleCI Workflows 2 | 3 | You can keep your app in sync with your GitHub repository with a **CircleCI workflow**. 4 | 5 | [CircleCI](https://circleci.com) is a continuous integration and continuous delivery (CI/CD) platform that helps automate the software development process. A [CircleCI workflow](https://circleci.com/docs/workflows/) is a set of automated tasks defined in a configuration file, orchestrated by CircleCI, to streamline the process of building, testing, and deploying software applications. 6 | 7 | *Note: For files larger than 10MB, Spaces requires Git-LFS. If you don't want to use Git-LFS, you may need to review your files and check your history. Use a tool like [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/) to remove any large files from your history. BFG Repo-Cleaner will keep a local copy of your repository as a backup.* 8 | 9 | First, set up your GitHub repository and Spaces app together. Add your Spaces app as an additional remote to your existing Git repository. 10 | 11 | ```bash 12 | git remote add space https://huggingface.co/spaces/HF_USERNAME/SPACE_NAME 13 | ``` 14 | 15 | Then force push to sync everything for the first time: 16 | 17 | ```bash 18 | git push --force space main 19 | ``` 20 | 21 | Next, set up a [CircleCI workflow](https://circleci.com/docs/workflows/) to push your `main` git branch to Spaces. 22 | 23 | In the example below: 24 | 25 | * Replace `HF_USERNAME` with your username and `SPACE_NAME` with your Space name. 26 | * [Create a context in CircleCI](https://circleci.com/docs/contexts/) and add an env variable into it called *HF_PERSONAL_TOKEN* (you can give it any name, use the key you create in place of HF_PERSONAL_TOKEN) and the value as your Hugging Face API token. You can find your Hugging Face API token under **API Tokens** on [your Hugging Face profile](https://huggingface.co/settings/tokens). 27 | 28 | ```yaml 29 | version: 2.1 30 | 31 | workflows: 32 | main: 33 | jobs: 34 | - sync-to-huggingface: 35 | context: 36 | - HuggingFace 37 | filters: 38 | branches: 39 | only: 40 | - main 41 | 42 | jobs: 43 | sync-to-huggingface: 44 | docker: 45 | - image: alpine 46 | resource_class: small 47 | steps: 48 | - run: 49 | name: install git 50 | command: apk update && apk add openssh-client git 51 | - checkout 52 | - run: 53 | name: push to Huggingface hub 54 | command: | 55 | git config user.email "" 56 | git config user.name "" 57 | git push -f https://HF_USERNAME:${HF_PERSONAL_TOKEN}@huggingface.co/spaces/HF_USERNAME/SPACE_NAME main 58 | ``` -------------------------------------------------------------------------------- /docs/hub/spaces-cookie-limitations.md: -------------------------------------------------------------------------------- 1 | # Cookie limitations in Spaces 2 | 3 | In Hugging Face Spaces, applications have certain limitations when using cookies. This is primarily due to the structure of the Spaces' pages (`https://huggingface.co/spaces//`), which contain applications hosted on a different domain (`*.hf.space`) within an iframe. For security reasons, modern browsers tend to restrict the use of cookies from iframe pages hosted on a different domain than the parent page. 4 | 5 | ## Impact on Hosting Streamlit Apps with Docker SDK 6 | 7 | One instance where these cookie restrictions can become problematic is when hosting Streamlit applications using the Docker SDK. By default, Streamlit enables cookie-based XSRF protection. As a result, certain components that submit data to the server, such as `st.file_uploader()`, will not work properly on HF Spaces where cookie usage is restricted. 8 | 9 | To work around this issue, you would need to set the `server.enableXsrfProtection` option in Streamlit to `false`. There are two ways to do this: 10 | 11 | 1. Command line argument: The option can be specified as a command line argument when running the Streamlit application. Here is the example command: 12 | ```shell 13 | streamlit run app.py --server.enableXsrfProtection false 14 | ``` 15 | 16 | 2. Configuration file: Alternatively, you can specify the option in the Streamlit configuration file `.streamlit/config.toml`. You would write it like this: 17 | ```toml 18 | [server] 19 | enableXsrfProtection = false 20 | ``` 21 | 22 | 23 | When you are using the Streamlit SDK, you don't need to worry about this because the SDK does it for you. 24 | 25 | -------------------------------------------------------------------------------- /docs/hub/spaces-dependencies.md: -------------------------------------------------------------------------------- 1 | # Handling Spaces Dependencies 2 | 3 | ## Default dependencies 4 | 5 | The default Spaces environment comes with several pre-installed dependencies: 6 | 7 | * The [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/index) client library allows you to manage your repository and files on the Hub with Python and programmatically access the Inference API from your Space. If you choose to instantiate the model in your app with the Inference API, you can benefit from the built-in acceleration optimizations. This option also consumes less computing resources, which is always nice for the environment! 🌎 8 | 9 | Refer to this [page](https://huggingface.co/docs/huggingface_hub/how-to-inference) for more information on how to programmatically access the Inference API. 10 | 11 | * [`requests`](https://docs.python-requests.org/en/master/) is useful for calling third-party APIs from your app. 12 | 13 | * [`datasets`](https://github.com/huggingface/datasets) allows you to fetch or display any dataset from the Hub inside your app. 14 | 15 | * The SDK you specified, which could be either `streamlit` or `gradio`. The version is specified in the `README.md` file. 16 | 17 | * Common Debian packages, such as `ffmpeg`, `cmake`, `libsm6`, and few others. 18 | 19 | ## Adding your own dependencies 20 | 21 | If you need other Python packages to run your app, add them to a **requirements.txt** file at the root of the repository. The Spaces runtime engine will create a custom environment on-the-fly. You can also add a **pre-requirements.txt** file describing dependencies that will be installed before your main dependencies. It can be useful if you need to update pip itself. 22 | 23 | Debian dependencies are also supported. Add a **packages.txt** file at the root of your repository, and list all your dependencies in it. Each dependency should be on a separate line, and each line will be read and installed by `apt-get install`. 24 | -------------------------------------------------------------------------------- /docs/hub/spaces-embed.md: -------------------------------------------------------------------------------- 1 | # Embed your Space in another website 2 | 3 | Once your Space is up and running you might wish to embed it in a website or in your blog. 4 | Embedding or sharing your Space is a great way to allow your audience to interact with your work and demonstrations without requiring any setup on their side. 5 | To embed a Space its visibility needs to be public. 6 | 7 | ## Direct URL 8 | 9 | A Space is assigned a unique URL you can use to share your Space or embed it in a website. 10 | 11 | This URL is of the form: `"https://.hf.space"`. For instance, the Space [NimaBoscarino/hotdog-gradio](https://huggingface.co/spaces/NimaBoscarino/hotdog-gradio) has the corresponding URL of `"https://nimaboscarino-hotdog-gradio.hf.space"`. The subdomain is unique and only changes if you move or rename your Space. 12 | 13 | Your space is always served from the root of this subdomain. 14 | 15 | You can find the Space URL along with examples snippets of how to embed it directly from the options menu: 16 | 17 |
18 | 19 | 20 |
21 | 22 | ## Embedding with IFrames 23 | 24 | The default embedding method for a Space is using IFrames. Add in the HTML location where you want to embed your Space the following element: 25 | 26 | ```html 27 | 33 | ``` 34 | 35 | For instance using the [NimaBoscarino/hotdog-gradio](https://huggingface.co/spaces/NimaBoscarino/hotdog-gradio) Space: 36 | 37 | 38 | ## Embedding with WebComponents 39 | 40 | If the Space you wish to embed is Gradio-based, you can use Web Components to embed your Space. WebComponents are faster than IFrames and automatically adjust to your web page so that you do not need to configure `width` or `height` for your element. 41 | First, you need to import the Gradio JS library that corresponds to the Gradio version in the Space by adding the following script to your HTML. 42 | 43 |
44 | 45 |
46 | 47 | Then, add a `gradio-app` element where you want to embed your Space. 48 | ```html 49 | 50 | ``` 51 | 52 | Check out the [Gradio documentation](https://www.gradio.app/guides/sharing-your-app#embedding-hosted-spaces) for more details. 53 | -------------------------------------------------------------------------------- /docs/hub/spaces-github-actions.md: -------------------------------------------------------------------------------- 1 | # Managing Spaces with Github Actions 2 | 3 | You can keep your app in sync with your GitHub repository with **Github Actions**. Remember that for files larger than 10MB, Spaces requires Git-LFS. If you don't want to use Git-LFS, you may need to review your files and check your history. Use a tool like [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/) to remove any large files from your history. BFG Repo-Cleaner will keep a local copy of your repository as a backup. 4 | 5 | First, you should set up your GitHub repository and Spaces app together. Add your Spaces app as an additional remote to your existing Git repository. 6 | 7 | ```bash 8 | git remote add space https://huggingface.co/spaces/HF_USERNAME/SPACE_NAME 9 | ``` 10 | 11 | Then force push to sync everything for the first time: 12 | 13 | ```bash 14 | git push --force space main 15 | ``` 16 | 17 | Next, set up a GitHub Action to push your main branch to Spaces. In the example below: 18 | 19 | * Replace `HF_USERNAME` with your username and `SPACE_NAME` with your Space name. 20 | * Create a [Github secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) with your `HF_TOKEN`. You can find your Hugging Face API token under **API Tokens** on your Hugging Face profile. 21 | 22 | ```yaml 23 | name: Sync to Hugging Face hub 24 | on: 25 | push: 26 | branches: [main] 27 | 28 | # to run this workflow manually from the Actions tab 29 | workflow_dispatch: 30 | 31 | jobs: 32 | sync-to-hub: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v3 36 | with: 37 | fetch-depth: 0 38 | lfs: true 39 | - name: Push to hub 40 | env: 41 | HF_TOKEN: ${{ secrets.HF_TOKEN }} 42 | run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/HF_USERNAME/SPACE_NAME main 43 | ``` 44 | 45 | Finally, create an Action that automatically checks the file size of any new pull request: 46 | 47 | 48 | ```yaml 49 | name: Check file size 50 | on: # or directly `on: [push]` to run the action on every push on any branch 51 | pull_request: 52 | branches: [main] 53 | 54 | # to run this workflow manually from the Actions tab 55 | workflow_dispatch: 56 | 57 | jobs: 58 | sync-to-hub: 59 | runs-on: ubuntu-latest 60 | steps: 61 | - name: Check large files 62 | uses: ActionsDesk/lfs-warning@v2.0 63 | with: 64 | filesizelimit: 10485760 # this is 10MB so we can sync to HF Spaces 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/hub/spaces-handle-url-parameters.md: -------------------------------------------------------------------------------- 1 | # How to handle URL parameters in Spaces 2 | 3 | You can use URL query parameters as a data sharing mechanism, for instance to be able to deep-link into an app with a specific state. 4 | 5 | On a Space page (`https://huggingface.co/spaces//`), the actual application page (`https://*.hf.space/`) is embedded in an iframe. The query string and the hash attached to the parent page URL are propagated to the embedded app on initial load, so the embedded app can read these values without special consideration. 6 | 7 | In contrast, updating the query string and the hash of the parent page URL from the embedded app is slightly more complex. 8 | If you want to do this in a Docker or static Space, you need to add the following JS code that sends a message to the parent page that has a `queryString` and/or `hash` key. 9 | 10 | ```js 11 | const queryString = "..."; 12 | const hash = "..."; 13 | 14 | window.parent.postMessage({ 15 | queryString, 16 | hash, 17 | }, "https://huggingface.co"); 18 | ``` 19 | 20 | **This is only for Docker or static Spaces.** 21 | 22 | For Streamlit apps, Spaces automatically syncs the URL parameters. Gradio apps can read the query parameters from the Spaces page, but do not sync updated URL parameters with the parent page. 23 | 24 | Note that the URL parameters of the parent page are propagated to the embedded app *only* on the initial load. So `location.hash` in the embedded app will not change even if the parent URL hash is updated using this method. 25 | 26 | An example of this method can be found in this static Space, 27 | [`whitphx/static-url-param-sync-example`](https://huggingface.co/spaces/whitphx/static-url-param-sync-example). 28 | -------------------------------------------------------------------------------- /docs/hub/spaces-more-ways-to-create.md: -------------------------------------------------------------------------------- 1 | # More ways to create Spaces 2 | 3 | ## Duplicating a Space 4 | 5 | You can duplicate a Space by clicking the three dots at the top right and selecting **Duplicate this Space**. Learn more about it [here](./spaces-overview#duplicating-a-space). 6 | 7 | ## Creating a Space from a model 8 | 9 | New! You can now create a Gradio demo directly from most model pages, using the "Deploy -> Spaces" button. 10 | 11 |