Skip to content

Commit

Permalink
Many changes made, checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
antonymilne committed Jan 22, 2025
1 parent a60d7ca commit 6ca29b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
24 changes: 11 additions & 13 deletions vizro-core/docs/pages/user-guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,12 @@ The best way to get started with Vizro on Hugging Face is to copy an existing Vi
If this is your first Vizro deployment then we recommend using our ["first dashboard" example](https://huggingface.co/spaces/vizro/demo-first-dashboard). This is a minimal example that is designed to make it as simple as possible to get started. You can create your own Vizro deployment on Hugging Face based on this template as follows:

1. [Sign up for a Hugging Face account](https://huggingface.co/join).
2. Copy our example Hugging Face dashboard by duplicating our ["first dashboard" example](https://huggingface.co/spaces/vizro/demo-first-dashboard) Space. To do so, click the following button:
[![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg)](https://huggingface.co/spaces/vizro/demo-first-dashboard?duplicate=true). This should open a window with the following form:
[![]](../../assets/user_guides/deploy/hugging_face_duplicate_this_space.png)
3. You do not need to alter any of the default options but if you would like to then refer to the [Hugging Face documentation](https://huggingface.co/docs/hub/en/spaces-overview#duplicating-a-space) for an explanation of each.
4. Click "Duplicate Space" to start building your Hugging Face Space. This takes around 10 seconds, and when complete you should see the following dashboard running.
[![]](../../assets/user_guides/deploy/hugging_face_space.png)
1. Copy our example Hugging Face dashboard by duplicating our ["first dashboard" example](https://huggingface.co/spaces/vizro/demo-first-dashboard) Space. To do so, click the following button: [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg)](https://huggingface.co/spaces/vizro/demo-first-dashboard?duplicate=true). This should open a window with the following form: ![Form to duplicate Space](../../assets/user_guides/deploy/hugging_face_duplicate_this_space.png)
1. You do not need to alter any of the default options but if you would like to then refer to the [Hugging Face documentation](https://huggingface.co/docs/hub/en/spaces-overview#duplicating-a-space) for an explanation of each.
1. Click "Duplicate Space" to start building your Hugging Face Space. This takes around 10 seconds, and when complete you should see the following dashboard running. ![Running dashboard](../../assets/user_guides/deploy/hugging_face_space.png)

To turn the example app into your own, you will need to edit the code in the `app.py` file. To do so, click on the Files tab at the top of your app and select `app.py`. Click the Edit button highlighted in the below screenshot to enter an editor view of the file.
[![]](../../assets/user_guides/deploy/hugging_face_edit_app.png)
To turn the example app into your own, you will need to edit the code in the `app.py` file. To do so, click on the Files tab at the top of your app and select `app.py`. Click the Edit button highlighted in the below screenshot to enter an editor view of the file.
![Edit app.py](../../assets/user_guides/deploy/hugging_face_edit_app.png)

You can now copy and paste your app code into the editor. When you've finished editing, click "Commit changes to `main`". This immediately triggers a rebuild of your Space. As with the initial build this takes around 10 seconds, and when complete you should be able to view your own app deployed on Hugging Face!

Expand All @@ -73,15 +70,16 @@ You can now copy and paste your app code into the editor. When you've finished e
Under the hood, your Space is a Git repository. Instead of editing files through your browser, you can use `git` from the command line and the Hugging Face CLI. The Hugging Face documentation contains [full instructions](https://huggingface.co/docs/hub/en/repositories-getting-started) on how to interact with your Space's git repository. Every time you make a commit to your repository, the Space is automatically rebuilt and restarted.

In addition to `app.py`, your Space contains a few other files:
* `.gitattributes` is used by [Git Large File Storage (LFS)](https://git-lfs.com/) and is only relevant if you have files larger than 10MB. See the [Hugging Face documentation](https://huggingface.co/docs/hub/en/repositories-getting-started) for more information.
* `Dockerfile` gives instructions to configure your app's environment and start the app. See our [section on Dockerfiles](#dockerfile) for more information.
* `README.md` configures your Space, for example its title, description and licence. See the [Hugging Face documentation](https://huggingface.co/docs/hub/en/spaces-config-reference) for more information.
* `requirements.txt` gives your Python package dependencies. See our [section on dependencies](#dependencies) for more information.

- `.gitattributes` is used by [Git Large File Storage (LFS)](https://git-lfs.com/) and is only relevant if you have files larger than 10MB. See the [Hugging Face documentation](https://huggingface.co/docs/hub/en/repositories-getting-started) for more information.
- `Dockerfile` gives instructions to configure your app's environment and start the app. See our [section on Dockerfiles](#dockerfile) for more information.
- `README.md` configures your Space, for example its title, description and licence. See the [Hugging Face documentation](https://huggingface.co/docs/hub/en/spaces-config-reference) for more information.
- `requirements.txt` gives your Python package dependencies. See our [section on dependencies](#dependencies) for more information.

!!! tip
If you'd like to show your Vizro app off to the community then you can add it to our [Vizro dashboard gallery](https://huggingface.co/collections/vizro/community-demos-666987c8e9f56afc7bc1d0fc).

On Hugging Face, Vizro apps are hosted on Docker Spaces. Hugging Face has thorough documentation on [Spaces in general](https://huggingface.co/docs/hub/en/spaces-overview) and specifically on [Docker Spaces](https://huggingface.co/docs/hub/en/spaces-sdks-docker-first-demo). There are many features that go beyond simply hosting a Vizro app. For example, you can [make a collection](https://huggingface.co/docs/hub/en/collections) of multiple Spaces, collaborate on your code using [pull requests and discussions](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions), or create an [organization](https://huggingface.co/docs/hub/en/organizations) to group accounts and Spaces together.
On Hugging Face, Vizro apps are hosted on Docker Spaces. Hugging Face has thorough documentation on [Spaces in general](https://huggingface.co/docs/hub/en/spaces-overview) and specifically on [Docker Spaces](https://huggingface.co/docs/hub/en/spaces-sdks-docker-first-demo). There are many features that go beyond simply hosting a Vizro app. For example, you can [make a collection](https://huggingface.co/docs/hub/en/collections) of multiple Spaces, collaborate on your code using [pull requests and discussions](https://huggingface.co/docs/hub/en/repositories-pull-requests-discussions), or create an [organization](https://huggingface.co/docs/hub/en/organizations) to group accounts and Spaces together.

## Ploomber Cloud

Expand Down
8 changes: 0 additions & 8 deletions vizro-core/docs/pages/user-guides/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,8 @@ This runs Vizro using the Flask development server and shows the resulting dashb
- Restart the Jupyter kernel and re-run your notebook.
- Add a cell containing `from vizro import Vizro; Vizro._reset()` to the top of your notebook and re-run it. With this method, there is no need to restart the Jupyter kernel.

---

start launch

!!! Flowchart?

## PyCafe

FEEDBACK LOOP

The easiest way to run a dashboard is to work on the code live on [PyCafe](https://py.cafe/).

Most of the Vizro documentation examples have a link below the code that reads "[Run and edit this code in PyCafe](https://py.cafe/vizro-official/vizro-iris-analysis)". Follow the link to open the code in PyCafe within an editor, such as the one below, which displays the dashboard and the code side by side.
Expand Down

0 comments on commit 6ca29b5

Please sign in to comment.