Spaces:
Sleeping
Sleeping
import streamlit as st | |
st.set_page_config( | |
page_title="Hello", | |
page_icon="π", | |
) | |
st.sidebar.success("Select a Page") | |
st.title('Getting Setup for Streamlit Spaces') | |
st.markdown(""" | |
## Step 1: Install what you need for this notebook | |
It is recommended you install into a conda environment: | |
``` | |
conda create -n DataVizClass python=3.10 | |
conda activate DataVizClass | |
``` | |
Then you can install the correct packages. | |
``` | |
pip install streamlit==1.39.0 altair numpy pandas matplotlib | |
``` | |
To work with the VSCode interface, be sure that `jupyter` is also installed: | |
``` | |
pip install jupyter | |
``` | |
Or you can install with `conda`. | |
Note that the package [Streamlit](https://streamlit.io/) that we will be working with requires we use Python scripts, so JupyterLab and/or Jupyter Notebooks won't work for this process. """) | |
st.markdown(""" | |
## Step 2: Clone the App files -- Option 1 (HuggingFace) | |
If you want to be able to deploy this app on HuggingFace, there are some extra steps required for setup (or skip to Option 2 for locally running things). | |
### Step 2.1: Set up a token to use with HuggingFace | |
Next you will create an [access token for your HuggingFace account](https://huggingface.co/docs/hub/en/security-tokens). | |
**Step 2.1.1:** Navigate to the "Access Tokens" page from "Settings" under your username: | |
""") | |
st.image("images/accesskey_p1.png") | |
st.markdown(""" | |
**Step 2.1.2:** Create a new finegrained token with read/write access to your personal repositories. | |
First, click on the "Create new token" button on this page. | |
Then select a Finegrained token with read/write access to your personal repos: | |
""") | |
st.image("images/accesskey_p2.png") | |
st.markdown(""" | |
**Step 2.1.3:** Generate the Token and *save it somewhere safe* | |
1. Click on `Create Token` at the bottom of the current page | |
2. *Save the token string somewhere safe!* We will be using this token throughout this class. | |
""") | |
st.markdown(""" | |
### Step 2.2: Duplicate the HuggingFace App | |
""") | |
st.markdown(""" | |
If you want to be able to deploy your own app on your own HuggingFace account, | |
you first need to duplicate this space. | |
To duplicate, right click on the 3 dots to the left of your profile icon: """) | |
st.image("images/duplicateSpace_p1.png") | |
st.markdown(""" | |
Make sure your user name is selected, and it is set to `Public` for visibility. Name the space whatever you want: | |
""") | |
st.image("images/duplicateSpace_p2.png") | |
st.markdown(""" | |
### Step 2.3: Clone *your duplicated* Space | |
""") | |
st.markdown(""" | |
First, be sure that `git-lfs` is installed, and then clone *your* duplicated space repo. | |
You can find instructions for this by once again right-clicking the 3 dots and clicking on "Clone Repository": | |
""") | |
st.image("images/clone_the_repo.png") | |
st.markdown(""" | |
Then you will be given this set of instructions (note your repo name will be different!): | |
""") | |
st.image("images/gitclone_hf.png") | |
st.markdown(""" | |
""") | |
st.markdown(""" | |
Now you should have a repository folder on your local computer that has your repo name and the files for this app. | |
""") | |
st.markdown(""" | |
## Step 2: Clone the App files -- Option 2 (GitHub) | |
""") | |
st.markdown(""" | |
If you don't want to mess around with HuggingFace and just want to play around with Streamlit locally, | |
you can also download these files from GitHub by [cloning this repository right here](https://github.com/jnaiman/shadisClassApp). | |
For info about using git commands to clone a repository, [see this link right here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository). | |
""") |