From 417baac859962f9c2f3ee70c0a5a8fc782611585 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Wed, 18 Jan 2023 16:42:01 +0100 Subject: [PATCH 1/2] Update docs on gradio and HF Hub --- docs/hf_hub.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/hf_hub.rst b/docs/hf_hub.rst index 8b5dd7cd..591f079c 100644 --- a/docs/hf_hub.rst +++ b/docs/hf_hub.rst @@ -119,13 +119,15 @@ Easily build user interfaces to your scikit-learn models -------------------------------------------------------- `gradio `__ is a python library that lets you create interfaces on your model. It has a class called `Interface `__ that lets you create application -interfaces to your machine learning models. +interfaces to your machine learning models. Using gradio can have some advantages over the using a plain +model repository, e.g. the widget allows uploading a csv for tabular data. + ``gradio`` is integrated with skops, so you can load an interface with only one line of code. During the initialization of the interface, call load method with -your repository identifier prepended with "huggingface/" will load an -interface for your model. The interface has a dataframe input that takes samples -and a dataframe output to return predictions. It also takes the example in the -repository that is previously pushed with skops. +your repository identifier prepended with "huggingface/" will load an +interface for your model. The interface has a dataframe input that takes samples +and a dataframe output to return predictions. It also takes the example in the +repository that is previously pushed with skops. Calling `gr.Interface.launch() `__ will launch your application. .. code:: python @@ -151,3 +153,9 @@ If you want to share your application continuously, you can deploy it to Hugging Face Spaces. You can check out `this blog `__ on how to do it. For more information, please refer to documentation of `gradio `__. + +It's also possible to spawn a gradio space directly from the model repository. +To achieve this, from the model page, click on ``Deploy`` (top right corner) > +``Spaces`` > ``Create new Space``, then follow the instructions. After +finishing, you get a gradio space hosted on Hugging Face Hub, with all the +benefits that brings. From 15371593d8c2b1431194f1474d9d3ed809977344 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Wed, 18 Jan 2023 17:40:20 +0100 Subject: [PATCH 2/2] Reviewer comment: More precise wording Co-authored-by: @merveenoyan --- docs/hf_hub.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hf_hub.rst b/docs/hf_hub.rst index 591f079c..d116ce56 100644 --- a/docs/hf_hub.rst +++ b/docs/hf_hub.rst @@ -120,7 +120,8 @@ Easily build user interfaces to your scikit-learn models `gradio `__ is a python library that lets you create interfaces on your model. It has a class called `Interface `__ that lets you create application interfaces to your machine learning models. Using gradio can have some advantages over the using a plain -model repository, e.g. the widget allows uploading a csv for tabular data. +model repository, e.g. the Gradio dataframe component allows uploading a csv for tabular data, unlike the +widget in the model repository. ``gradio`` is integrated with skops, so you can load an interface with only one line of code. During the initialization of the interface, call load method with