From 9c57f5943d1ea69be62d26d48ca6c83eb697ff2f Mon Sep 17 00:00:00 2001 From: "Ankush Pala ankush@lastmileai.dev" <> Date: Fri, 9 Feb 2024 19:33:03 -0500 Subject: [PATCH 1/2] [docs] Rename gradio-workbook page to gradio-notebook title --- aiconfig-docs/docs/{gradio-workbook.md => gradio-notebook.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename aiconfig-docs/docs/{gradio-workbook.md => gradio-notebook.md} (100%) diff --git a/aiconfig-docs/docs/gradio-workbook.md b/aiconfig-docs/docs/gradio-notebook.md similarity index 100% rename from aiconfig-docs/docs/gradio-workbook.md rename to aiconfig-docs/docs/gradio-notebook.md From cbbfa42aab4faf62c7c6b8cdf173038239a8c681 Mon Sep 17 00:00:00 2001 From: "Ankush Pala ankush@lastmileai.dev" <> Date: Fri, 9 Feb 2024 19:33:03 -0500 Subject: [PATCH 2/2] [docs] Rename Workbook References to Notebook Updated text references and hyperlinks from Workbook to Notebook. Will need to update images. --- aiconfig-docs/docs/gradio-notebook.md | 54 ++++++++++++++------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/aiconfig-docs/docs/gradio-notebook.md b/aiconfig-docs/docs/gradio-notebook.md index 7a55de509..5180d2748 100644 --- a/aiconfig-docs/docs/gradio-notebook.md +++ b/aiconfig-docs/docs/gradio-notebook.md @@ -6,35 +6,37 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/tabConstants'; -# Gradio Workbooks +# Gradio Notebooks -[Gradio Workbooks](https://huggingface.co/spaces/lastmileai/gradio-workbook-template) is a Gradio custom component that creates a notebook playground on Hugging Face Spaces with only [8-lines of code](https://huggingface.co/spaces/lastmileai/gradio-workbook-template/blob/main/app.py)! +[Gradio Notebook](https://huggingface.co/spaces/lastmileai/gradio-notebook-template) is a Gradio custom component that creates a notebook playground on Hugging Face Spaces with only [8-lines of code](https://huggingface.co/spaces/lastmileai/gradio-notebook-template/blob/main/app.py)! You can: -* Use any model, and a combination of models, in a single space -* Play around with models in any format (text, audio image) and ordering -* Share Space output results with friends + +- Use any model, and a combination of models, in a single space +- Play around with models in any format (text, audio image) and ordering +- Share Space output results with friends
- workbook + notebook

## Quickstart -### 1. Create a new Space with Gradio Workbooks +### 1. Create a new Space with Gradio Notebooks -- **Option 1: Start with a template**. Duplicate the [Gradio Workbook Quickstart Space](https://huggingface.co/spaces/lastmileai/gradio-workbook-template). +- **Option 1: Start with a template**. Duplicate the [Gradio Notebook Quickstart Space](https://huggingface.co/spaces/lastmileai/gradio-notebook-template). - **Option 2: Create from scratch**. Create a [new Gradio SDK Space](https://huggingface.co/new-space) and add these files to your Space repo. To add files to your Space repo, you can do so through the [Web UI](https://huggingface.co/docs/hub/repositories-getting-started#adding-files-to-a-repository-web-ui) or [terminal](https://huggingface.co/docs/hub/repositories-getting-started#terminal). - - [app.py](https://huggingface.co/spaces/lastmileai/gradio-workbook-template/blob/main/app.py) - - [requirements.txt](https://huggingface.co/spaces/lastmileai/gradio-workbook-template/blob/main/requirements.txt) + - [app.py](https://huggingface.co/spaces/lastmileai/gradio-notebook-template/blob/main/app.py) + - [requirements.txt](https://huggingface.co/spaces/lastmileai/gradio-notebook-template/blob/main/requirements.txt) ### 2. Design your Space + Use the playground UI in your space to setup your models and prompts that you want on your space. -- **Add a new cell with '+'.** Gradio Workbooks are made up cells. Each cell allows you to prompt a specific model. +- **Add a new cell with '+'.** Gradio Notebooks are made up cells. Each cell allows you to prompt a specific model. - **Select the model for your cell.** First, choose the [Hugging Face Task](#supported-models) for this cell. Then, click on the Cell Settings panel to select a model for that task. The model needs to available on the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index) - check the model card on Hugging Face. - **Note: Edits/changes won’t save automatically.** Refreshing the page will lose your edits. @@ -54,35 +56,35 @@ Anyone who now visits your Space will see the state represented by `my_app.aicon ## Features -### Gradio Workbook Structure +### Gradio Notebook Structure -Gradio Workbooks are inspired by [Jupyter notebooks](https://jupyter.org/). Each workbook is made up of cells. The cell is associated with a model and running the cell executes it with your prompt. +Gradio Notebooks are inspired by [Jupyter notebooks](https://jupyter.org/). Each Notebook is made up of cells. The cell is associated with a model and running the cell executes it with your prompt.
- workbook + notebook
### Parameters -Parameters are variables that you can define and pass into any cell within your workbook. You can set both **global parameters** and **local parameters**. +Parameters are variables that you can define and pass into any cell within your notebook. You can set both **global parameters** and **local parameters**. For example, the prompt `"A large, friendly {{animal}} wearing a {{color}} hat"` generates the following images for different parameters:
- workbook + notebook
#### Global Parameters -You can set global parameters for your entire workbook. Click on **Global Parameters {}** on the top of your workbook and set your global parameters that can be used in any cell of the workbook. +You can set global parameters for your entire notebook. Click on **Global Parameters {}** on the top of your notebook and set your global parameters that can be used in any cell of the notebook.
- workbook + notebook
@@ -92,20 +94,20 @@ You can set local parameters that only apply to the cell you are in. Click on th
- workbook + notebook
### Chaining -You can reference the output from one cell in another cell. This allows you to create complex, interconnected workflows within your workbook. +You can reference the output from one cell in another cell. This allows you to create complex, interconnected workflows within your notebook. The image_gen prompt below uses the output of the prompt_1 using handlebars syntax (e.g `{{prompt_1.output}}`)
- workbook + notebook
@@ -113,7 +115,7 @@ The image_gen prompt below uses the output of the prompt_1 using handlebars synt Click **Download** to download the `aiconfig.json` file that captures the current state of your Space. Example Space and corresponding `aiconfig.json` file: -- [Gradio Workbook Space](https://huggingface.co/spaces/lastmileai/ai_story_generator) +- [Gradio notebook Space](https://huggingface.co/spaces/lastmileai/ai_story_generator) - [my_app.aiconfig.json](https://huggingface.co/spaces/lastmileai/ai_story_generator/blob/main/story_gen.aiconfig.json) Reasons for Downloading: @@ -121,15 +123,15 @@ Reasons for Downloading: 1. **Lock in edits to your Space.** Refreshing your Space does not save changes. You need to upload the downloaded `aiconfig.json` file to your Space repo to lock in the state. Make sure you name your `aiconfig.json` file as `my_app.aiconfig.json` - it’s referenced in `app.py`. 2. **Build apps inspired by your Space.** HuggingFace Spaces offer cool demos, but building an app with the tested models and prompts is challenging. However, by downloading the `aiconfig.json` file, you can use the prompts (and models) from your Space in your code with the [AIConfig SDK](https://github.com/lastmile-ai/aiconfig). -### Share Workbook +### Share Norkbook -Click **Share Workbook** to get a link to a read-only copy of your Space to share with the rest of the world! +Click **Share Notebook** to get a link to a read-only copy of your Space to share with the rest of the world! ![sharing](https://github.com/lastmile-ai/aiconfig/assets/81494782/ceadc825-9df3-4192-b033-117ee1d40590) ### Build apps inspired by Spaces -You can easily build generative apps inspired by your work in Gradio Workbook Spaces! Both Space creators and Space viewers can download the `aiconfig.json` file to capture the state of their Space. +You can easily build generative apps inspired by your work in Gradio Notebook Spaces! Both Space creators and Space viewers can download the `aiconfig.json` file to capture the state of their Space. Use the `aiconfig.json` file in your code with the [AIConfig SDK](https://github.com/lastmile-ai/aiconfig) in 2 lines. @@ -142,7 +144,7 @@ model_output = await config.run('prompt_1') ## Supported Models -- **Gradio Workbooks support models which use the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).** [Hugging Face Tasks](https://huggingface.co/tasks) that are supported: +- **Gradio Notebooks support models which use the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).** [Hugging Face Tasks](https://huggingface.co/tasks) that are supported: - [Text Generation](https://huggingface.co/tasks/text-generation) - [Summarization](https://huggingface.co/tasks/summarization) - [Translation](https://huggingface.co/tasks/translation)