CHEESE API

Once you have a pipeline, data, and a frontend set up, running CHEESE (and adding or removing clients) is simple! You just launch CHEESE and add as many clients as you wish.

class cheese.api.CHEESE(pipeline_cls, client_cls=None, model_cls=None, pipeline_kwargs: Dict[str, Any] = {}, model_kwargs: Dict[str, Any] = {}, gradio: bool = True)[source]

Main object to use for running tasks with CHEESE

Parameters
  • pipeline_cls (Callable[, Pipeline]) – Class for pipeline

  • client_cls (Callable[,GradioFront] if gradio) – Class for client

  • model_cls (Callable[,BaseModel]) – Class for model

  • pipeline_kwargs (Dict[str, Any]) – Additional keyword arguments to pass to pipeline constructor

  • gradio (bool) – Whether to use gradio or custom frontend

create_client(id: int)Tuple[int, int][source]

Create a client instance with given id.

Parameters

id (int) – A unique identifying number for the client.

Returns

Username and password user can use to log in to CHEESE

draw()[source]

Draws a sample from data pipeline and creates a task to send to clients. Does nothing if no free clients.

launch()str[source]

Launch the frontend and return URL for users to access it.