Update app.py
Browse files
app.py
CHANGED
|
@@ -276,13 +276,12 @@ def crewai_process(research_topic):
|
|
| 276 |
|
| 277 |
return result
|
| 278 |
|
| 279 |
-
|
|
|
|
| 280 |
|
| 281 |
st.set_page_config(page_title='Clarifai Story Teller', layout='wide')
|
| 282 |
|
| 283 |
|
| 284 |
-
st.session_state.text_block = ""
|
| 285 |
-
|
| 286 |
# Create tabs
|
| 287 |
tab1, tab2, tab3 = st.tabs(["Create Your Story Script", "Build Your Image-Audio Book", "Interact with Your Charaters"])
|
| 288 |
|
|
@@ -300,11 +299,12 @@ with tab1:
|
|
| 300 |
# Run the crewai process
|
| 301 |
result = crewai_process(input_topic)
|
| 302 |
# Display the result
|
| 303 |
-
|
| 304 |
-
st.text_area("Output", value=st.session_state
|
| 305 |
|
| 306 |
# Tab 2: Data Visualization
|
| 307 |
with tab2:
|
|
|
|
| 308 |
# Streamlit page configuration
|
| 309 |
#st.set_page_config(Create Image and Audio Generator', layout='wide')
|
| 310 |
|
|
@@ -314,7 +314,7 @@ with tab2:
|
|
| 314 |
# Streamlit main page
|
| 315 |
# st.title('Images and Audio with Clarifai')
|
| 316 |
if st.button("Generate Images and Audio"):
|
| 317 |
-
sentence_chunks = split_text_into_sentences_and_chunks(
|
| 318 |
prompts = [' '.join(chunk) for chunk in sentence_chunks]
|
| 319 |
cols = st.columns(4)
|
| 320 |
with st.spinner('Generating Content...'):
|
|
|
|
| 276 |
|
| 277 |
return result
|
| 278 |
|
| 279 |
+
if 'my_variable' not in st.session_state:
|
| 280 |
+
st.session_state['text_block'] = ''
|
| 281 |
|
| 282 |
st.set_page_config(page_title='Clarifai Story Teller', layout='wide')
|
| 283 |
|
| 284 |
|
|
|
|
|
|
|
| 285 |
# Create tabs
|
| 286 |
tab1, tab2, tab3 = st.tabs(["Create Your Story Script", "Build Your Image-Audio Book", "Interact with Your Charaters"])
|
| 287 |
|
|
|
|
| 299 |
# Run the crewai process
|
| 300 |
result = crewai_process(input_topic)
|
| 301 |
# Display the result
|
| 302 |
+
st.session_state['text_block'] = result
|
| 303 |
+
st.text_area("Output", value=st. st.session_state['text_block'] , height=300)
|
| 304 |
|
| 305 |
# Tab 2: Data Visualization
|
| 306 |
with tab2:
|
| 307 |
+
tab2var_textblock = st.session_state['text_block']
|
| 308 |
# Streamlit page configuration
|
| 309 |
#st.set_page_config(Create Image and Audio Generator', layout='wide')
|
| 310 |
|
|
|
|
| 314 |
# Streamlit main page
|
| 315 |
# st.title('Images and Audio with Clarifai')
|
| 316 |
if st.button("Generate Images and Audio"):
|
| 317 |
+
sentence_chunks = split_text_into_sentences_and_chunks(tab2var_textblock , 8)
|
| 318 |
prompts = [' '.join(chunk) for chunk in sentence_chunks]
|
| 319 |
cols = st.columns(4)
|
| 320 |
with st.spinner('Generating Content...'):
|