BOINC AI Hub
  • 🌍BOINC AI Hub
  • 🌍Repositories
  • Getting Started with Repositories
  • Repository Settings
  • Pull Requests & Discussions
  • Notifications
  • Collections
  • 🌍Webhooks
    • How-to: Automatic fine-tuning with Auto-Train
    • How-to: Build a Discussion bot based on BLOOM
    • How-to: Create automatic metadata quality reports
  • Repository size recommendations
  • Next Steps
  • Licenses
  • 🌍Models
  • The Model Hub
  • 🌍Model Cards
    • Annotated Model Card
    • Carbon Emissions
    • Model Card Guidebook
    • Landscape Analysis
  • Gated Models
  • Uploading Models
  • Downloading Models
  • 🌍Integrated Libraries
    • Adapter Transformers
    • AllenNLP
    • Asteroid
    • Diffusers
    • ESPnet
    • fastai
    • Flair
    • Keras
    • ML-Agents
    • PaddleNLP
    • RL-Baselines3-Zoo
    • Sample Factory
    • Sentence Transformers
    • spaCy
    • SpanMarker
    • SpeechBrain
    • Stable-Baselines3
    • Stanza
    • TensorBoard
    • timm
    • Transformers
    • Transformers.js
  • 🌍Model Widgets
    • Widget Examples
  • Inference API docs
  • Frequently Asked Questions
  • 🌍Advanced Topics
    • Integrate a library with the Hub
    • Tasks
  • 🌍Datasets
  • Datasets Overview
  • Dataset Cards
  • Gated Datasets
  • Dataset Viewer
  • Using Datasets
  • Adding New Datasets
  • 🌍Spaces
  • 🌍Spaces Overview
    • Handling Spaces Dependencies
    • Spaces Settings
    • Using Spaces for Organization Cards
  • Spaces GPU Upgrades
  • Spaces Persistent Storage
  • Gradio Spaces
  • Streamlit Spaces
  • Static HTML Spaces
  • 🌍Docker Spaces
    • Your first Docker Spaces
    • Example Docker Spaces
    • Argilla on Spaces
    • Label Studio on Spaces
    • Aim on Space
    • Livebook on Spaces
    • Shiny on Spaces
    • ZenML on Spaces
    • Panel on Spaces
    • ChatUI on Spaces
    • Tabby on Spaces
  • Embed your Space
  • Run Spaces with Docker
  • Spaces Configuration Reference
  • Sign-In with BA button
  • Spaces Changelog
  • 🌍Advanced Topics
    • Using OpenCV in Spaces
    • More ways to create Spaces
    • Managing Spaces with Github Actions
    • Custom Python Spaces
    • How to Add a Space to ArXiv
    • Cookie limitations in Spaces
  • 🌍Other
  • 🌍Organizations
    • Managing Organizations
    • Organization Cards
    • Access Control in Organizations
  • Billing
  • 🌍Security
    • User Access Tokens
    • Git over SSH
    • Signing Commits with GPG
    • Single Sign-On (SSO)
    • Malware Scanning
    • Pickle Scanning
    • Secrets Scanning
  • Moderation
  • Paper Pages
  • Search
  • Digital Object Identifier (DOI)
  • Hub API Endpoints
  • Sign-In with BA
Powered by GitBook
On this page
  • Tasks
  • What’s a task?
  • Overview
  • Adding new tasks to the Hub
  1. Advanced Topics

Tasks

PreviousIntegrate a library with the HubNextDatasets

Last updated 1 year ago

Tasks

What’s a task?

Tasks, or pipeline types, describe the “shape” of each model’s API (inputs and outputs) and are used to determine which Inference API and widget we want to display for any given model.

This classification is relatively coarse-grained (you can always add more fine-grained task names in your model tags), so you should rarely have to create a new task. If you want to add support for a new task, this document explains the required steps.

Overview

Having a new task integrated into the Hub means that:

  • Users can search for all models – and datasets – of a given task.

  • The Inference API supports the task.

  • Users can try out models directly with the widget. 🏆

Note that you don’t need to implement all the steps by yourself. Adding a new task is a community effort, and multiple people can contribute. 🧑‍🤝‍🧑

To begin the process, open a new issue in the repository. Please use the “Adding a new task” template. ⚠️Before doing any coding, it’s suggested to go over this document. ⚠️

The first step is to upload a model for your proposed task. Once you have a model in the Hub for the new task, the next step is to enable it in the Inference API. There are three types of support that you can choose from:

  • 🌍 using a transformers model

  • 🐳 using a model from an

  • 🖨️ using a model with custom inference code. This experimental option has downsides, so we recommend using one of the other approaches.

Finally, you can add a couple of UI elements, such as the task icon and the widget, that complete the integration in the Hub. 📷

Some steps are orthogonal; you don’t need to do them in order. You don’t need the Inference API to add the icon. This means that, even if there isn’t full integration yet, users can still search for models of a given task.

Adding new tasks to the Hub

Using BOINC AI transformers library

If your model is a transformers-based model, there is a 1:1 mapping between the Inference API task and a pipeline class. Here are some example PRs from the transformers library:

Once the pipeline is submitted and deployed, you should be able to use the Inference API for your model.

Using Community Inference API with a supported library

Adding a new task is relatively straightforward and requires 2 PRs:

Adding Community Inference API for a quick prototype

My model is not supported by any library. Am I doomed? 😱

UI elements

The Hub allows users to filter models by a given task. To do this, you need to add the task to several places. You’ll also get to pick an icon for the task!

  1. Add the task type to Types.ts

  • Add the type to PIPELINE_DATA. Note that pipeline types are sorted into different categories (NLP, Audio, Computer Vision, and others).

  • You will also need to fill minor changes in the following files:

  1. Choose an icon

Widget

The Hub also supports over 10 open-source libraries in the .

PR 1: Add the new task to the API . This code ensures that the inference input is valid for a given task. Some PR examples:

PR 2: Add the new task to a library docker image. You should also add a template to to facilitate integrating the task in other libraries. Here is an example PR:

No, you’re not! The is an experimental Docker image for quickly prototyping new tasks and introducing new libraries, which should allow you to have a new task in production with very little development from your side.

How does it work from the user’s point of view? Users create a copy of a repo for their given task. Users then need to define their requirements.txt and fill pipeline.py. Note that this is intended for quick experimentation and prototyping instead of fast production use-cases.

In , you need to do a couple of things

You can add an icon in the directory. We usually choose carbon icons from . Also add the icon to .

Once the task is in production, what could be more exciting than implementing some way for users to play directly with the models in their browser? 🤩 You can find all the widgets .

If you would be interested in contributing with a widget, you can look at the of all the widgets. You can also find WIP documentation on implementing a widget in .

🌍
Adding ImageClassificationPipeline
Adding AudioClassificationPipeline
Community Inference API
validation
Add text-to-image
Add audio-classification
Add tabular-classification
docker_images/common/app/pipelines
Add text-classification to spaCy
generic Inference API
template
interfaces/Types.ts
tasks/src/const.ts
tasks/src/tasksData.ts
lib/Icons
https://icones.js.org/collection/carbon
PipelineIcon
here
implementation
https://github.com/boincai/hub-docs/tree/main/js
huggingface_hub
officially supported library