Spaces:
Sleeping
Sleeping
Delete streamlit-1.25.py
Browse files- pages/streamlit-1.25.py +0 -78
pages/streamlit-1.25.py
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
import datetime
|
2 |
-
import time
|
3 |
-
import streamlit as st
|
4 |
-
import numpy as np
|
5 |
-
|
6 |
-
st.title("Streamlit App at Hugging Face Spaces!")
|
7 |
-
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
|
8 |
-
|
9 |
-
with st.form("my_form"):
|
10 |
-
st.write("Inside the form")
|
11 |
-
slider_val = st.slider("Form slider")
|
12 |
-
checkbox_val = st.checkbox("Form checkbox")
|
13 |
-
|
14 |
-
for i in range(100):
|
15 |
-
st.write('placeholder')
|
16 |
-
|
17 |
-
# Every form must have a submit button.
|
18 |
-
submitted = st.form_submit_button("Submit")
|
19 |
-
if submitted:
|
20 |
-
st.write("slider", slider_val, "checkbox", checkbox_val)
|
21 |
-
|
22 |
-
col1, col2, col3 = st.columns(3)
|
23 |
-
|
24 |
-
with col1:
|
25 |
-
st.image("https://static.streamlit.io/examples/cat.jpg")
|
26 |
-
|
27 |
-
with col2:
|
28 |
-
st.image("https://static.streamlit.io/examples/dog.jpg")
|
29 |
-
|
30 |
-
with col3:
|
31 |
-
st.image("https://static.streamlit.io/examples/owl.jpg")
|
32 |
-
|
33 |
-
with st.sidebar:
|
34 |
-
# st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png")
|
35 |
-
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
|
36 |
-
values = st.slider(
|
37 |
-
'Select a range of values',
|
38 |
-
0.0, 100.0, (25.0, 75.0))
|
39 |
-
st.write('Values:', values)
|
40 |
-
|
41 |
-
appointment = st.slider(
|
42 |
-
"Schedule your appointment:",
|
43 |
-
value=(datetime.time(11, 30), datetime.time(12, 45)))
|
44 |
-
st.write("You're scheduled for:", appointment)
|
45 |
-
|
46 |
-
start_time = st.slider(
|
47 |
-
"When do you start?",
|
48 |
-
value=datetime.datetime(2020, 1, 1, 9, 30),
|
49 |
-
format="MM/DD/YY - hh:mm")
|
50 |
-
st.write("Start time:", start_time)
|
51 |
-
|
52 |
-
for i in range(100):
|
53 |
-
st.write('placeholder')
|
54 |
-
|
55 |
-
if st.button('Three cheers'):
|
56 |
-
st.toast('Hip!')
|
57 |
-
time.sleep(.5)
|
58 |
-
st.toast('Hip!')
|
59 |
-
time.sleep(.5)
|
60 |
-
st.toast('Hooray!', icon='🎉')
|
61 |
-
|
62 |
-
if "chat_messages" not in st.session_state:
|
63 |
-
st.session_state.chat_messages = []
|
64 |
-
|
65 |
-
prompt = st.chat_input("Say something")
|
66 |
-
if prompt:
|
67 |
-
st.session_state.chat_messages.append({"type": "user", "message": prompt})
|
68 |
-
st.session_state.chat_messages.append({"type": "bot", "message": "Hello!", "chart": np.random.randn(30, 3)})
|
69 |
-
|
70 |
-
for message in st.session_state.chat_messages[::-1]:
|
71 |
-
if message["type"] == "user":
|
72 |
-
with st.chat_message("You"):
|
73 |
-
st.write(message["message"])
|
74 |
-
else:
|
75 |
-
with st.chat_message("Bot"):
|
76 |
-
st.write(message["message"])
|
77 |
-
st.line_chart(message["chart"])
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|