Spaces:
Runtime error
Runtime error
updating select_cta_button
Browse files- __pycache__/main_app.cpython-311.pyc +0 -0
- __pycache__/utils.cpython-311.pyc +0 -0
- app.py +10 -5
__pycache__/main_app.cpython-311.pyc
ADDED
|
Binary file (495 Bytes). View file
|
|
|
__pycache__/utils.cpython-311.pyc
ADDED
|
Binary file (23.9 kB). View file
|
|
|
app.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import PIL
|
| 4 |
-
import ipywidgets
|
| 5 |
from joblib import dump, load
|
| 6 |
|
| 7 |
from bokeh.models.widgets import Div
|
|
@@ -178,7 +180,6 @@ call2action_feature = st.selectbox(
|
|
| 178 |
call2action
|
| 179 |
)
|
| 180 |
|
| 181 |
-
|
| 182 |
def generate_cta_list(num_text):
|
| 183 |
cta_list = []
|
| 184 |
for i in range(num_text):
|
|
@@ -416,9 +417,13 @@ def select_cta_button(ccolor, text):
|
|
| 416 |
#st.write(st.session_state)
|
| 417 |
buttons_out=[]
|
| 418 |
for x in np.arange(len(st.session_state.ccolor)):
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
return buttons_out
|
| 423 |
'''def toggle_all(change):
|
| 424 |
for cb in user_input:
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
|
| 4 |
import pandas as pd
|
| 5 |
import PIL
|
| 6 |
+
# import ipywidgets
|
| 7 |
from joblib import dump, load
|
| 8 |
|
| 9 |
from bokeh.models.widgets import Div
|
|
|
|
| 180 |
call2action
|
| 181 |
)
|
| 182 |
|
|
|
|
| 183 |
def generate_cta_list(num_text):
|
| 184 |
cta_list = []
|
| 185 |
for i in range(num_text):
|
|
|
|
| 417 |
#st.write(st.session_state)
|
| 418 |
buttons_out=[]
|
| 419 |
for x in np.arange(len(st.session_state.ccolor)):
|
| 420 |
+
ctab=st.button("Call_To_Action text: "+str(st.session_state.text[x])+"; color: "+str(st.session_state.ccolor[x]), key = x)
|
| 421 |
+
res=[]
|
| 422 |
+
res.append(x)
|
| 423 |
+
val={}
|
| 424 |
+
val['value']=ctab
|
| 425 |
+
res.append(val)
|
| 426 |
+
buttons_out.append(res)
|
| 427 |
return buttons_out
|
| 428 |
'''def toggle_all(change):
|
| 429 |
for cb in user_input:
|