Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlit annotation example #506

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 5 additions & 37 deletions examples/streamlit/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,8 @@
# Using W&B and Streamlit
# Examples of using W&B with Streamlit

## Description
Use Streamlit with W&B for quick, interactive apps.
We have two example use cases here in this repo:

Example repo to show off the different possibilties when utilizing both W&B and Streamlit. In this repo we hit two scenarios in terms of interaction with W&B and Streamlit.
1. **Quickstart**: Embed an iframe of W&B in a Streamlit app
2. **Annotation**: Interactively annotate LLM data

1. Embed an IFrame of the WANDB dashboard within the Streamlit application. This is shown in the application when selecting the `Embed IFrame` option. In this variant we allow users to select a project and run. We then display both the project dashboard and run dashboard from WANDB

2. Use WANDB traiditionally to log artifacts that can be pulled from an experiment to visualize traditionally. This is shown in the application when selecting the `Use WANDB Logging` option. In this variant we provide a minimal example of an WANDB experiment that can be run to the users account upon click. When said experiment is finished, it should load in a logged HTML page saved in WANDB to the file directory of the Streamlit project to then be displayed by Stteamlit.

## Install

```
pip install -r requirements.txt
```

Generate a `.env` file in the root of the project with variables:

```
WANDB_API_KEY=<WANDB_API_KEY>
WANDB_ENTITY=<WANDB_ENTITY_NAME>
```

## Usage

To run streamlit on localhost use command: `streamlit run wandb_streamlit_app.py`

## Examples

### WANDB Project Dashboard

<img src="./static/gifs/embed_wandb_project_dash.gif"/>

### WANDB Run Dashboard

<img src="./static/gifs/embed_wandb_run_dash.gif"/>

### WANDB HTML Artifact rendered via Streamlit

<img src="./static/gifs/use_wandb_logging.gif"/>
Loading
Loading