whitphx's picture
whitphx HF staff
Update app.py
30fdd3f
from datetime import datetime, time
import streamlit as st
st.title("Streamlit App at Hugging Face Spaces!")
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
with st.form("my_form"):
st.write("Inside the form")
slider_val = st.slider("Form slider")
checkbox_val = st.checkbox("Form checkbox")
# Every form must have a submit button.
submitted = st.form_submit_button("Submit")
if submitted:
st.write("slider", slider_val, "checkbox", checkbox_val)
uploaded_file = st.file_uploader("Upload file")
col1, col2, col3 = st.columns(3)
with col1:
st.image("https://static.streamlit.io/examples/cat.jpg")
with col2:
st.image("https://static.streamlit.io/examples/dog.jpg")
with col3:
st.image("https://static.streamlit.io/examples/owl.jpg")
with st.sidebar:
# st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png")
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
values = st.slider(
'Select a range of values',
0.0, 100.0, (25.0, 75.0))
st.write('Values:', values)
appointment = st.slider(
"Schedule your appointment:",
value=(time(11, 30), time(12, 45)))
st.write("You're scheduled for:", appointment)
start_time = st.slider(
"When do you start?",
value=datetime(2020, 1, 1, 9, 30),
format="MM/DD/YY - hh:mm")
st.write("Start time:", start_time)