├── scripts └── api-inference │ ├── .gitignore │ ├── scripts │ └── .gitignore │ ├── .prettierignore │ ├── README.md │ ├── templates │ ├── common │ │ ├── specs-output.handlebars │ │ ├── specs-payload.handlebars │ │ ├── snippets-template.handlebars │ │ ├── page-header.handlebars │ │ └── specs-headers.handlebars │ └── task │ │ ├── text-to-image.handlebars │ │ ├── translation.handlebars │ │ ├── fill-mask.handlebars │ │ ├── image-segmentation.handlebars │ │ ├── question-answering.handlebars │ │ ├── table-question-answering.handlebars │ │ ├── image-classification.handlebars │ │ ├── object-detection.handlebars │ │ ├── summarization.handlebars │ │ ├── text-classification.handlebars │ │ ├── audio-classification.handlebars │ │ ├── image-to-image.handlebars │ │ ├── automatic-speech-recognition.handlebars │ │ ├── feature-extraction.handlebars │ │ ├── zero-shot-classification.handlebars │ │ ├── image-text-to-text.handlebars │ │ ├── text-generation.handlebars │ │ ├── token-classification.handlebars │ │ └── chat-completion.handlebars │ ├── tsconfig.json │ └── package.json ├── docs ├── hub │ ├── _config.py │ ├── models-advanced.md │ ├── spaces-organization-cards.md │ ├── spaces-using-opencv.md │ ├── spaces-advanced.md │ ├── spaces-settings.md │ ├── other.md │ ├── _redirects.yml │ ├── spaces-more-ways-to-create.md │ ├── spaces-run-with-docker.md │ ├── spaces-sdks-docker-argilla.md │ ├── datasets.md │ ├── models-the-hub.md │ ├── models.md │ ├── repositories.md │ ├── enterprise-hub-datasets.md │ ├── organizations.md │ ├── spaces-sdks-static.md │ ├── organizations-managing.md │ ├── notebooks.md │ ├── datasets-polars-file-formats.md │ ├── spaces-sdks-python.md │ ├── tensorboard.md │ ├── datasets-usage.md │ ├── spaces-sdks-docker-examples.md │ ├── moderation.md │ ├── enterprise-sso.md │ ├── datasets-download-stats.md │ ├── enterprise-hub-resource-groups.md │ ├── organizations-cards.md │ ├── security-secrets.md │ ├── security.md │ ├── spaces-cookie-limitations.md │ ├── spaces-handle-url-parameters.md │ ├── enterprise-hub.md │ ├── datasets-viewer-configure.md │ ├── datasets-polars-auth.md │ ├── security-malware.md │ ├── search.md │ ├── datasets-overview.md │ ├── datasets-duckdb-auth.md │ ├── spaces-dependencies.md │ ├── enterprise-hub-advanced-security.md │ ├── stanza.md │ ├── gguf-gpt4all.md │ ├── model-cards-components.md │ ├── tf-keras.md │ ├── rl-baselines3-zoo.md │ ├── spaces.md │ ├── datasets-downloading.md │ ├── security-protectai.md │ ├── datasets-polars.md │ ├── gguf-llamacpp.md │ ├── spaces-github-actions.md │ ├── models-inference.md │ ├── spaces-sdks-docker-chatui.md │ ├── enterprise-hub-analytics.md │ ├── spaces-circleci.md │ ├── spaces-sdks-docker-jupyter.md │ ├── repositories-settings.md │ ├── spaces-sdks-docker-evidence.md │ ├── speechbrain.md │ ├── transformers-js.md │ ├── spaces-embed.md │ ├── ml-agents.md │ ├── flair.md │ ├── models-downloading.md │ ├── setfit.md │ ├── fastai.md │ ├── audit-logs.md │ ├── organizations-security.md │ ├── datasets-duckdb.md │ ├── espnet.md │ ├── keras.md │ ├── asteroid.md │ ├── models-download-stats.md │ ├── datasets-polars-optimizations.md │ ├── diffusers.md │ ├── stable-baselines3.md │ ├── open_clip.md │ ├── span_marker.md │ └── paper-pages.md ├── api-inference │ ├── _redirects.yml │ ├── security.md │ ├── pricing.md │ ├── _toctree.yml │ └── index.md ├── sagemaker │ └── _toctree.yml └── TODOs.md ├── .gitignore ├── .git-blame-ignore-revs ├── .github ├── workflows │ ├── delete_doc_comment_trigger.yml │ ├── sagemaker_delete_doc_comment.yml │ ├── trufflehog.yml │ ├── delete_doc_comment.yml │ ├── upload_pr_documentation.yml │ ├── sagemaker_upload_pr_documentation.yml │ ├── api_inference_upload_pr_documentation.yml │ ├── build_documentation.yml │ ├── sagemaker_build_documentation.yml │ ├── api_inference_build_documentation.yml │ ├── build_pr_documentation.yml │ ├── sagemaker_build_pr_documentation.yml │ ├── api_inference_build_pr_documentation.yml │ ├── model_card_consistency_reminder.yml │ └── api_inference_generate_documentation.yml └── ISSUE_TEMPLATE │ ├── documentation-request.md │ ├── feature_request.md │ └── bugs.md └── README.md /scripts/api-inference/.gitignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /docs/hub/_config.py: -------------------------------------------------------------------------------- 1 | disable_toc_check = True 2 | -------------------------------------------------------------------------------- /scripts/api-inference/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | *.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | __pycache__/ 3 | .vscode/ 4 | .idea/ 5 | 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /scripts/api-inference/.prettierignore: -------------------------------------------------------------------------------- 1 | pnpm-lock.yaml 2 | # In order to avoid code samples to have tabs, they don't display well on npm 3 | README.md 4 | dist 5 | *.handlebars -------------------------------------------------------------------------------- /scripts/api-inference/README.md: -------------------------------------------------------------------------------- 1 | Install dependencies. 2 | 3 | ```sh 4 | pnpm install 5 | ``` 6 | 7 | Generate documentation. 8 | 9 | ```sh 10 | pnpm run generate 11 | ``` -------------------------------------------------------------------------------- /docs/api-inference/_redirects.yml: -------------------------------------------------------------------------------- 1 | quicktour: index 2 | detailed_parameters: parameters 3 | parallelism: getting_started 4 | usage: getting_started 5 | faq: index 6 | rate-limits: pricing 7 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /scripts/api-inference/templates/common/specs-output.handlebars: -------------------------------------------------------------------------------- 1 | | Body | | 2 | | :--- | :--- | :--- | 3 | {{#each schema}} 4 | {{#if type}} 5 | | **{{{name}}}** | _{{type}}_ | {{{description}}} | 6 | {{else}} 7 | | **{{{name}}}** | | {{{description}}} | 8 | {{/if}} 9 | {{/each}} -------------------------------------------------------------------------------- /scripts/api-inference/templates/common/specs-payload.handlebars: -------------------------------------------------------------------------------- 1 | | Payload | | | 2 | | :--- | :--- | :--- | 3 | {{#each schema}} 4 | {{#if type}} 5 | | **{{{name}}}{{#if required}}*{{/if}}** | _{{type}}_ | {{{description}}} | 6 | {{else}} 7 | | **{{{name}}}** | | {{{description}}} | 8 | {{/if}} 9 | {{/each}} -------------------------------------------------------------------------------- /docs/hub/spaces-organization-cards.md: -------------------------------------------------------------------------------- 1 | # Using Spaces for Organization Cards 2 | 3 | Organization cards are a way to describe your organization to other users. They take the form of a `README.md` static file, inside a Space repo named `README`. 4 | 5 | Please read more in the [dedicated doc section](./organizations-cards). 6 | -------------------------------------------------------------------------------- /docs/sagemaker/_toctree.yml: -------------------------------------------------------------------------------- 1 | - local: index 2 | title: Hugging Face on Amazon SageMaker 3 | - local: getting-started 4 | title: Get started 5 | - local: train 6 | title: Run training on Amazon SageMaker 7 | - local: inference 8 | title: Deploy models to Amazon SageMaker 9 | - local: reference 10 | title: Reference -------------------------------------------------------------------------------- /.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/sagemaker_delete_doc_comment.yml: -------------------------------------------------------------------------------- 1 | name: Delete sagemaker 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/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/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/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/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 }} -------------------------------------------------------------------------------- /docs/hub/spaces-using-opencv.md: -------------------------------------------------------------------------------- 1 | # Using OpenCV in Spaces 2 | 3 | In order to use OpenCV in your Gradio or Streamlit Spaces, you'll need to make the Space install both the Python and Debian dependencies 4 | 5 | This means adding `python3-opencv` to the `packages.txt` file, and adding `opencv-python` to the `requirements.txt` file. If those files don't exist, you'll need to create them. 6 | 7 | To see an example, [see this Gradio project](https://huggingface.co/spaces/templates/gradio_opencv/tree/main). 8 | -------------------------------------------------------------------------------- /.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 }} -------------------------------------------------------------------------------- /.github/workflows/api_inference_upload_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Upload Inference API PR Documentation 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["Build Inference API 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: api-inference 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 | -------------------------------------------------------------------------------- /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-settings.md: -------------------------------------------------------------------------------- 1 | # Spaces Settings 2 | 3 | You can configure your Space's appearance and other settings inside the `YAML` block at the top of the **README.md** file at the root of the repository. For example, if you want to create a Space with Gradio named `Demo Space` with a yellow to orange gradient thumbnail: 4 | 5 | ```yaml 6 | --- 7 | title: Demo Space 8 | emoji: 🤗 9 | colorFrom: yellow 10 | colorTo: orange 11 | sdk: gradio 12 | app_file: app.py 13 | pinned: false 14 | --- 15 | ``` 16 | 17 | For additional settings, refer to the [Reference](./spaces-config-reference) section. 18 | -------------------------------------------------------------------------------- /.github/workflows/sagemaker_build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build sagemaker documentation 2 | 3 | on: 4 | push: 5 | paths: 6 | - "docs/sagemaker/**" 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: sagemaker 17 | path_to_docs: hub-docs/docs/sagemaker/ 18 | additional_args: --not_python_module 19 | secrets: 20 | hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} 21 | -------------------------------------------------------------------------------- /scripts/api-inference/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "lib": ["ES2022", "DOM"], 5 | "module": "ESNext", 6 | "target": "ESNext", 7 | "moduleResolution": "node", 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "strictNullChecks": true, 12 | "skipLibCheck": true, 13 | "noImplicitOverride": true, 14 | "outDir": "./dist", 15 | "declaration": true, 16 | "declarationMap": true 17 | }, 18 | "include": ["scripts"], 19 | "exclude": ["dist"] 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/api_inference_build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build Inference API documentation 2 | 3 | on: 4 | push: 5 | paths: 6 | - "docs/api-inference/**" 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: api-inference 17 | path_to_docs: hub-docs/docs/api-inference/ 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 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/text-to-image.handlebars: -------------------------------------------------------------------------------- 1 | ## Text to Image 2 | 3 | Generate an image based on a given text prompt. 4 | 5 | {{{tips.linksToTaskPage.text-to-image}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.text-to-image}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.text-to-image}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.text-to-image}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.text-to-image.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.text-to-image.output}}} 30 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/translation.handlebars: -------------------------------------------------------------------------------- 1 | ## Translation 2 | 3 | Translation is the task of converting text from one language to another. 4 | 5 | {{{tips.linksToTaskPage.translation}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.translation}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.translation}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.translation}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.translation.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.translation.output}}} 30 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/fill-mask.handlebars: -------------------------------------------------------------------------------- 1 | ## Fill-mask 2 | 3 | Mask filling is the task of predicting the right word (token to be precise) in the middle of a sequence. 4 | 5 | {{{tips.linksToTaskPage.fill-mask}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.fill-mask}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.fill-mask}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.fill-mask}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.fill-mask.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.fill-mask.output}}} 30 | -------------------------------------------------------------------------------- /.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 | 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: sagemaker 20 | path_to_docs: hub-docs/docs/sagemaker/ 21 | additional_args: --not_python_module 22 | -------------------------------------------------------------------------------- /.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_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build Inference API PR Documentation 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - "docs/api-inference/**" 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: api-inference 20 | path_to_docs: hub-docs/docs/api-inference/ 21 | additional_args: --not_python_module 22 | -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /scripts/api-inference/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api-inference-generator", 3 | "packageManager": "pnpm@9.7.1", 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "type": "module", 8 | "scripts": { 9 | "format": "prettier --write .", 10 | "format:check": "prettier --check .", 11 | "generate": "tsx scripts/generate.ts" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "ISC", 16 | "dependencies": { 17 | "@huggingface/tasks": "^0.14.0", 18 | "@types/node": "^22.5.0", 19 | "handlebars": "^4.7.8", 20 | "node": "^20.17.0", 21 | "prettier": "^3.3.3", 22 | "ts-node": "^10.9.2", 23 | "tsx": "^4.17.0", 24 | "type-fest": "^4.25.0", 25 | "typescript": "^5.5.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/image-segmentation.handlebars: -------------------------------------------------------------------------------- 1 | ## Image Segmentation 2 | 3 | Image Segmentation divides an image into segments where each pixel in the image is mapped to an object. 4 | 5 | {{{tips.linksToTaskPage.image-segmentation}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.image-segmentation}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.image-segmentation}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.image-segmentation}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.image-segmentation.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.image-segmentation.output}}} 30 | 31 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/question-answering.handlebars: -------------------------------------------------------------------------------- 1 | ## Question Answering 2 | 3 | Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document. 4 | 5 | {{{tips.linksToTaskPage.question-answering}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.question-answering}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.question-answering}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.question-answering}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.question-answering.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.question-answering.output}}} 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/table-question-answering.handlebars: -------------------------------------------------------------------------------- 1 | ## Table Question Answering 2 | 3 | Table Question Answering (Table QA) is the answering a question about an information on a given table. 4 | 5 | {{{tips.linksToTaskPage.table-question-answering}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.table-question-answering}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.table-question-answering}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.table-question-answering}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.table-question-answering.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.table-question-answering.output}}} 30 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/image-classification.handlebars: -------------------------------------------------------------------------------- 1 | ## Image Classification 2 | 3 | Image classification is the task of assigning a label or class to an entire image. Images are expected to have only one class for each image. 4 | 5 | {{{tips.linksToTaskPage.image-classification}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.image-classification}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.image-classification}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.image-classification}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.image-classification.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.image-classification.output}}} 30 | 31 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/object-detection.handlebars: -------------------------------------------------------------------------------- 1 | ## Object detection 2 | 3 | Object Detection models allow users to identify objects of certain defined classes. These models receive an image as input and output the images with bounding boxes and labels on detected objects. 4 | 5 | {{{tips.linksToTaskPage.object-detection}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.object-detection}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.object-detection}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.object-detection}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.object-detection.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.object-detection.output}}} 30 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/summarization.handlebars: -------------------------------------------------------------------------------- 1 | ## Summarization 2 | 3 | Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text. 4 | 5 | {{{tips.linksToTaskPage.summarization}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.summarization}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.summarization}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.summarization}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.summarization.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.summarization.output}}} 30 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /docs/TODOs.md: -------------------------------------------------------------------------------- 1 | ## For API-Inference docs: 2 | 3 | From https://github.com/huggingface/hub-docs/pull/1413: 4 | * Use ` for getting started 5 | * Add some screenshots: supported models 6 | * Add flow chart of how API works 7 | * Add table with all tasks 8 | * Add missing tasks: depth estimation and zero shot image classification 9 | * Some tasks have no warm models, should we remove them for now? E.g. https://huggingface.co/models?inference=warm&pipeline_tag=fill-mask&sort=trending BUT many are cold and working, so actually linking to both could make sense - internal issue https://github.com/huggingface-internal/moon-landing/issues/10966 10 | * See also this [google doc](https://docs.google.com/document/d/1xy5Ug4C_qGbqp4x3T3rj_VOyjQzQLlyce-L6I_hYi94/edit?usp=sharing) 11 | * Add CI to auto-generate the docs when handlebars template are updated -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/text-classification.handlebars: -------------------------------------------------------------------------------- 1 | ## Text Classification 2 | 3 | Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness. 4 | 5 | {{{tips.linksToTaskPage.text-classification}}} 6 | 7 | ### Recommended models 8 | 9 | {{#each models.text-classification}} 10 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 11 | {{/each}} 12 | 13 | {{{tips.listModelsLink.text-classification}}} 14 | 15 | ### Using the API 16 | 17 | {{{snippets.text-classification}}} 18 | 19 | ### API specification 20 | 21 | #### Request 22 | 23 | {{{specs.text-classification.input}}} 24 | 25 | {{{constants.specsHeaders}}} 26 | 27 | #### Response 28 | 29 | {{{specs.text-classification.output}}} 30 | -------------------------------------------------------------------------------- /scripts/api-inference/templates/task/audio-classification.handlebars: -------------------------------------------------------------------------------- 1 | ## Audio Classification 2 | 3 | Audio classification is the task of assigning a label or class to a given audio. 4 | 5 | Example applications: 6 | * Recognizing which command a user is giving 7 | * Identifying a speaker 8 | * Detecting the genre of a song 9 | 10 | {{{tips.linksToTaskPage.audio-classification}}} 11 | 12 | ### Recommended models 13 | 14 | {{#each models.audio-classification}} 15 | - [{{this.id}}](https://huggingface.co/{{this.id}}): {{this.description}} 16 | {{/each}} 17 | 18 | {{{tips.listModelsLink.audio-classification}}} 19 | 20 | ### Using the API 21 | 22 | {{{snippets.audio-classification}}} 23 | 24 | ### API specification 25 | 26 | #### Request 27 | 28 | {{{specs.audio-classification.input}}} 29 | 30 | {{{constants.specsHeaders}}} 31 | 32 | #### Response 33 | 34 | {{{specs.audio-classification.output}}} 35 | -------------------------------------------------------------------------------- /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 |