whitphx HF staff commited on
Commit
ddb8000
1 Parent(s): da91343

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -0
app.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datetime import datetime, time
2
+ import streamlit as st
3
+
4
+
5
+ st.title("Streamlit App at Hugging Face Spaces!")
6
+ st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
7
+
8
+ with st.form("my_form"):
9
+ st.write("Inside the form")
10
+ slider_val = st.slider("Form slider")
11
+ checkbox_val = st.checkbox("Form checkbox")
12
+
13
+ # Every form must have a submit button.
14
+ submitted = st.form_submit_button("Submit")
15
+ if submitted:
16
+ st.write("slider", slider_val, "checkbox", checkbox_val)
17
+
18
+ col1, col2, col3 = st.columns(3)
19
+
20
+ with col1:
21
+ st.image("https://static.streamlit.io/examples/cat.jpg")
22
+
23
+ with col2:
24
+ st.image("https://static.streamlit.io/examples/dog.jpg")
25
+
26
+ with col3:
27
+ st.image("https://static.streamlit.io/examples/owl.jpg")
28
+
29
+ with st.sidebar:
30
+ # st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png")
31
+ st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
32
+ values = st.slider(
33
+ 'Select a range of values',
34
+ 0.0, 100.0, (25.0, 75.0))
35
+ st.write('Values:', values)
36
+
37
+ appointment = st.slider(
38
+ "Schedule your appointment:",
39
+ value=(time(11, 30), time(12, 45)))
40
+ st.write("You're scheduled for:", appointment)
41
+
42
+ start_time = st.slider(
43
+ "When do you start?",
44
+ value=datetime(2020, 1, 1, 9, 30),
45
+ format="MM/DD/YY - hh:mm")
46
+ st.write("Start time:", start_time)