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
  • Shiny on Spaces
  • Shiny for Python
  • Shiny for R
  1. Docker Spaces

Shiny on Spaces

PreviousLivebook on SpacesNextZenML on Spaces

Last updated 1 year ago

Shiny on Spaces

is an open-source framework for building simple, beautiful, and performant data applications. The goal when developing Shiny was to build something simple enough to teach someone in an afternoon but extensible enough to power large, mission-critical applications. You can create a useful Shiny app in a few minutes, but if the scope of your project grows, you can be sure that Shiny can accommodate that application.

The main feature that differentiates Shiny from other frameworks is its reactive execution model. When you write a Shiny app, the framework infers the relationship between inputs, outputs, and intermediary calculations and uses those relationships to render only the things that need to change as a result of a userโ€™s action. The result is that users can easily develop efficient, extensible applications without explicitly caching data or writing callback functions.

Shiny for Python

is a pure Python implementation of Shiny. This gives you access to all of the great features of Shiny like reactivity, complex layouts, and modules without needing to use R. Shiny for Python is ideal for Hugging Face applications because it integrates smoothly with other Hugging Face tools.

To get started deploying a Space, click this button to select your hardware and specify if you want a public or private Space. The Space template will populate a few files to get your app started.

app.py

This file defines your appโ€™s logic. To learn more about how to modify this file, see . As your app gets more complex, itโ€™s a good idea to break your application logic up into .

Dockerfile

The Dockerfile for a Shiny for Python app is very minimal because the library doesnโ€™t have many system dependencies, but you may need to modify this file if your application has additional system dependencies. The one essential feature of this file is that it exposes and runs the app on the port specified in the space README file (which is 7860 by default).

requirements.txt

The Space will automatically install dependencies listed in the requirements.txt file. Note that you must include shiny in this file.

Shiny for R

is a popular and well-established application framework in the R community and is a great choice if you want to host an R app on Hugging Face infrastructure or make use of some of the great . To integrate Hugging Face tools into an R app, you can either use to call Hugging Face APIs, or to call one of the Hugging Face Python SDKs.

To deploy an R Shiny Space, click this button and fill out the space metadata. This will populate the Space with all the files you need to get started.

app.R This file contains all of your application logic. If you prefer, you can break this file up into ui.R and server.R.

Dockerfile

There are two main requirements for this Dockerfile:

  • First, the file must expose the port that you have listed in the README. The default is 7860 and we recommend not changing this port unless you have a reason to.

The Dockerfile builds off of the the image. Youโ€™ll need to modify this file to use additional packages. If you are using a lot of tidyverse packages we recommend switching the base image to . You can install additional R packages by adding them under the RUN install2.r section of the dockerfile, and github packages can be installed by adding the repository under RUN installGithub.r.

Second, for the moment you must use the development version of which resolves an issue with app timeouts on Hugging Face.

๐ŸŒ
rocker shiny
rocker/shinyverse
httpuv
Shiny
Shiny for Python
the Shiny for Python documentation
modules
Shiny for R
Shiny R extensions
httr2
reticulate