seawolf2357
commited on
Commit
β’
edb7029
1
Parent(s):
6602e76
Update app.py
Browse files
app.py
CHANGED
@@ -1,37 +1,47 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import numpy as np
|
3 |
+
import matplotlib.pyplot as plt
|
4 |
|
5 |
+
# μ λͺ©
|
6 |
+
st.title("Hugging Faceμ Streamlitμ μ¬μ©ν μ ν리μΌμ΄μ
")
|
7 |
+
|
8 |
+
# ν
μ€νΈ μ
λ ₯
|
9 |
+
user_input = st.text_input("ν
μ€νΈλ₯Ό μ
λ ₯νμΈμ:", "Streamlitμ μ λ§ λ©μ Έμ!")
|
10 |
+
|
11 |
+
# μ«μ μ
λ ₯
|
12 |
+
number_input = st.number_input("μ«μλ₯Ό μ
λ ₯νμΈμ:", min_value=0.0, max_value=100.0, value=50.0)
|
13 |
+
|
14 |
+
# μ¬λΌμ΄λ
|
15 |
+
slider_input = st.slider("μ¬λΌμ΄λλ‘ μ«μλ₯Ό μ ννμΈμ:", 0, 100, 25)
|
16 |
+
|
17 |
+
# νμΌ μ
λ‘λ
|
18 |
+
uploaded_file = st.file_uploader("νμΌμ μ
λ‘λνμΈμ:", type=["csv", "txt"])
|
19 |
+
|
20 |
+
# 체ν¬λ°μ€
|
21 |
+
if st.checkbox("체ν¬λ°μ€λ₯Ό μ ννμΈμ:"):
|
22 |
+
st.write("체ν¬λ°μ€κ° μ νλμμ΅λλ€!")
|
23 |
+
|
24 |
+
# λΌλμ€ λ²νΌ
|
25 |
+
radio_choice = st.radio("λΌλμ€ λ²νΌμ μ ννμΈμ:", ("μ΅μ
1", "μ΅μ
2", "μ΅μ
3"))
|
26 |
+
st.write(f"λΉμ μ {radio_choice}μ μ ννμ΅λλ€.")
|
27 |
+
|
28 |
+
# μ
λ νΈλ°μ€
|
29 |
+
option = st.selectbox("μ
λ νΈλ°μ€μμ μ΅μ
μ μ ννμΈμ:", ("μ΅μ
A", "μ΅μ
B", "μ΅μ
C"))
|
30 |
+
st.write(f"λΉμ μ {option}μ μ ννμ΅λλ€.")
|
31 |
+
|
32 |
+
# λ©ν°μ
λ νΈ
|
33 |
+
options = st.multiselect("λ©ν°μ
λ νΈμμ μ¬λ¬ μ΅μ
μ μ ννμΈμ:", ["μ΅μ
1", "μ΅μ
2", "μ΅μ
3", "μ΅μ
4"])
|
34 |
+
st.write("λΉμ μ ", options, "μ μ ννμ΅λλ€.")
|
35 |
+
|
36 |
+
# λ²νΌ
|
37 |
+
if st.button("ν΄λ¦νμΈμ!"):
|
38 |
+
st.write("λ²νΌμ΄ ν΄λ¦λμμ΅λλ€!")
|
39 |
+
|
40 |
+
# λ°μ΄ν° μκ°ν
|
41 |
+
st.subheader("κ°λ¨ν μ°¨νΈ:")
|
42 |
+
# 무μμ λ°μ΄ν° μμ±
|
43 |
+
data = np.random.randn(100)
|
44 |
+
# matplotlibλ₯Ό μ¬μ©ν μ°¨νΈ
|
45 |
+
fig, ax = plt.subplots()
|
46 |
+
ax.hist(data, bins=20)
|
47 |
+
st.pyplot(fig)
|