-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathstreamlit_tutorial.py
34 lines (28 loc) · 1.19 KB
/
streamlit_tutorial.py
1
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
import streamlit as st
from streamlit_extras.switch_page_button import switch_page
def main():
st.title('Bienvenido al portal predictivo de la empresa XYZ')
st.write('**Por favor seleccione el servicio predictivo que desea utilizar**')
opcion = st.radio('Seleccione el servicio:',
('Predicción del tipo de flor (con CSV)', 'Predicción del tipo de flor (manualmente)', 'Predicción de imagen','Maqueta','Sliders'),
index=0,
key='option')
if st.button('Empezar!'):
route_prediction(opcion)
def route_prediction(opcion):
if opcion == 'Predicción del tipo de flor (con CSV)':
switch_page("pred_iris_csv")
elif opcion == 'Predicción del tipo de flor (manualmente)':
switch_page("pred_iris_man")
elif opcion == 'Predicción de imagen':
switch_page("pred_imagen")
elif opcion == 'Maqueta':
switch_page("maqueta")
elif opcion == 'Sliders':
switch_page("sliders")
if __name__ == "__main__":
main()
# https://docs.streamlit.io/library/get-started/multipage-apps
# Local: streamlit run streamlit_tutorial.py
# Streamlit Sharing
# render, heroku, AWS EC2