Spaces:
Sleeping
Sleeping
Commit
·
3d8f4dd
1
Parent(s):
ad1c4cd
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -26,90 +26,136 @@ def on_btn_click():
|
|
26 |
|
27 |
|
28 |
def main():
|
29 |
-
st.
|
|
|
|
|
30 |
(
|
31 |
col1,
|
32 |
col2,
|
33 |
) = st.columns(2)
|
34 |
with col1:
|
35 |
-
|
36 |
with col2:
|
37 |
-
option = st.selectbox(
|
|
|
|
|
38 |
(
|
39 |
col1,
|
40 |
col2,
|
41 |
) = st.columns(2)
|
42 |
with col1:
|
43 |
-
|
|
|
|
|
44 |
with col2:
|
45 |
-
|
|
|
|
|
46 |
(
|
47 |
col1,
|
48 |
col2,
|
49 |
) = st.columns(2)
|
50 |
with col1:
|
51 |
-
|
52 |
with col2:
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
columns=["lat", "lon"],
|
69 |
-
),
|
70 |
-
get_position="[lon, lat]",
|
71 |
-
radius=200,
|
72 |
-
elevation_scale=4,
|
73 |
-
elevation_range=[0, 1000],
|
74 |
-
pickable=True,
|
75 |
-
extruded=True,
|
76 |
-
),
|
77 |
-
pdk.Layer(
|
78 |
-
"ScatterplotLayer",
|
79 |
-
data=pd.DataFrame(
|
80 |
-
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],
|
81 |
-
columns=["lat", "lon"],
|
82 |
-
),
|
83 |
-
get_position="[lon, lat]",
|
84 |
-
get_color="[200, 30, 0, 160]",
|
85 |
-
get_radius=200,
|
86 |
-
),
|
87 |
-
],
|
88 |
)
|
89 |
-
|
90 |
-
|
91 |
-
st.altair_chart(
|
92 |
-
alt.Chart(
|
93 |
pd.DataFrame(
|
94 |
{
|
95 |
-
"
|
96 |
-
|
97 |
-
|
98 |
-
"
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
)
|
101 |
)
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
)
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
use_container_width=True,
|
112 |
)
|
|
|
113 |
|
114 |
|
115 |
if __name__ == "__main__":
|
|
|
26 |
|
27 |
|
28 |
def main():
|
29 |
+
st.write("Hello, world!")
|
30 |
+
st.header(" Al Generated this app - spotify recommendations")
|
31 |
+
st.subheader(" this application contains the auto generated layout")
|
32 |
(
|
33 |
col1,
|
34 |
col2,
|
35 |
) = st.columns(2)
|
36 |
with col1:
|
37 |
+
st.write("Hello, world!")
|
38 |
with col2:
|
39 |
+
option = st.selectbox(
|
40 |
+
" gender / male / female", [" gender ", " male ", " female"]
|
41 |
+
)
|
42 |
(
|
43 |
col1,
|
44 |
col2,
|
45 |
) = st.columns(2)
|
46 |
with col1:
|
47 |
+
value = st.slider(
|
48 |
+
" max predictions", min_value=0, max_value=100, value=50, key=61
|
49 |
+
)
|
50 |
with col2:
|
51 |
+
value = st.slider(
|
52 |
+
" num categories", min_value=0, max_value=100, value=50, key=65
|
53 |
+
)
|
54 |
(
|
55 |
col1,
|
56 |
col2,
|
57 |
) = st.columns(2)
|
58 |
with col1:
|
59 |
+
option = st.radio("Choose an option:", ["Option 1", "Option 2", "Option 3"])
|
60 |
with col2:
|
61 |
+
if st.checkbox("Check me"):
|
62 |
+
st.write("Checkbox checked!")
|
63 |
+
if st.button(" generate recommendations"):
|
64 |
+
st.write("Button clicked!")
|
65 |
+
(
|
66 |
+
col1,
|
67 |
+
col2,
|
68 |
+
) = st.columns(2)
|
69 |
+
with col1:
|
70 |
+
st.table(
|
71 |
+
{
|
72 |
+
"Country": ["USA", "Canada", "UK", "Australia"],
|
73 |
+
"Population (millions)": [331, 38, 66, 25],
|
74 |
+
"GDP (trillion USD)": [22.675, 1.843, 2.855, 1.488],
|
75 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
)
|
77 |
+
with col2:
|
78 |
+
st.line_chart(
|
|
|
|
|
79 |
pd.DataFrame(
|
80 |
{
|
81 |
+
"Apple": yf.download("AAPL", start="2023-01-01", end="2023-07-31")[
|
82 |
+
"Adj Close"
|
83 |
+
],
|
84 |
+
"Google": yf.download(
|
85 |
+
"GOOGL", start="2023-01-01", end="2023-07-31"
|
86 |
+
)["Adj Close"],
|
87 |
+
"Microsoft": yf.download(
|
88 |
+
"MSFT", start="2023-01-01", end="2023-07-31"
|
89 |
+
)["Adj Close"],
|
90 |
}
|
91 |
)
|
92 |
)
|
93 |
+
(
|
94 |
+
col1,
|
95 |
+
col2,
|
96 |
+
) = st.columns(2)
|
97 |
+
with col1:
|
98 |
+
data = pd.DataFrame(
|
99 |
+
{"X": [1, 2, 3, 4, 5], "Y1": [10, 16, 8, 14, 12], "Y2": [5, 8, 3, 6, 7]}
|
100 |
+
)
|
101 |
+
st.area_chart(data)
|
102 |
+
with col2:
|
103 |
+
st.bar_chart(
|
104 |
+
pd.DataFrame(np.random.randn(20, 3), columns=["Apple", "Banana", "Cherry"])
|
105 |
+
)
|
106 |
+
(
|
107 |
+
col1,
|
108 |
+
col2,
|
109 |
+
) = st.columns(2)
|
110 |
+
with col1:
|
111 |
+
st.write("Hello, world!")
|
112 |
+
with col2:
|
113 |
+
df = px.data.gapminder().query("year == 2007").query("continent == 'Americas'")
|
114 |
+
fig = px.pie(
|
115 |
+
df,
|
116 |
+
values="pop",
|
117 |
+
names="country",
|
118 |
+
title="Population of American continent",
|
119 |
+
hover_data=["lifeExp"],
|
120 |
+
labels={"lifeExp": "life expectancy"},
|
121 |
+
)
|
122 |
+
fig.update_traces(textposition="inside", textinfo="percent+label")
|
123 |
+
st.plotly_chart(fig)
|
124 |
+
source = vds.cars()
|
125 |
+
chart = {
|
126 |
+
"mark": "point",
|
127 |
+
"encoding": {
|
128 |
+
"x": {"field": "Horsepower", "type": "quantitative"},
|
129 |
+
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
|
130 |
+
"color": {"field": "Origin", "type": "nominal"},
|
131 |
+
"shape": {"field": "Origin", "type": "nominal"},
|
132 |
+
},
|
133 |
+
}
|
134 |
+
tab1, tab2 = st.tabs(["Streamlit theme (default)", "Vega-Lite native theme"])
|
135 |
+
with tab1:
|
136 |
+
st.vega_lite_chart(source, chart, theme="streamlit", use_container_width=True)
|
137 |
+
with tab2:
|
138 |
+
st.vega_lite_chart(source, chart, theme=None, use_container_width=True)
|
139 |
+
(
|
140 |
+
col1,
|
141 |
+
col2,
|
142 |
+
) = st.columns(2)
|
143 |
+
with col1:
|
144 |
+
st.video("https://www.youtube.com/watch?v=50hVvC7gMR8&t=5s", format="video/mp4")
|
145 |
+
with col2:
|
146 |
+
st.image(
|
147 |
+
"https://assets-global.website-files.com/59e16042ec229e00016d3a66/6441d5f76d21e1e4dee9ffa2_Gen%20AI%20blog_Blog%20hero.png",
|
148 |
+
caption="Image Caption",
|
149 |
)
|
150 |
+
st.plotly_chart(
|
151 |
+
ff.create_distplot(
|
152 |
+
[np.random.randn(200) - 2, np.random.randn(200), np.random.randn(200) + 2],
|
153 |
+
["Negative Shift", "Normal", "Positive Shift"],
|
154 |
+
bin_size=[0.1, 0.25, 0.5],
|
155 |
+
),
|
156 |
use_container_width=True,
|
157 |
)
|
158 |
+
st.header(" auto generated by sketch2streamiit")
|
159 |
|
160 |
|
161 |
if __name__ == "__main__":
|