Skip to content

Commit 0b920f0

Browse files
author
melihunsal
committed
code added
1 parent 49d3a1e commit 0b920f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/prompt_based/app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def generate_response(txt):
5959

6060
example_submitted = False
6161

62+
final_code_empty = st.empty()
63+
6264
with st.form('a', clear_on_submit=True):
6365
submitted = st.form_submit_button('Submit')
6466
for col,example in zip(cols,examples):
@@ -92,7 +94,9 @@ def generate_response(txt):
9294
if success:
9395
bar.progress(75, text=PROGRESS_BAR_TEXTS["creating"])
9496
example_submitted = False
95-
st.session_state['pid'] = streamlit_agent(demo_idea,demo_title,code,test_code,bar.progress,st.balloons)
97+
st.session_state['pid'], streamlit_code = streamlit_agent(demo_idea,demo_title,code,test_code,bar.progress,st.balloons)
98+
with st.expander("Code"):
99+
st.code(streamlit_code)
96100
sleep(5)
97101
webbrowser.open('http://localhost:8502')
98102

src/prompt_based/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,4 @@ def __call__(self,topic, title, code, test_code,progress_func,success_func):
286286
refined_code = self.refine_code(streamlit_code)
287287
progress_func(100,"Redirecting to the demo page...")
288288
success_func()
289-
return self.run_code(refined_code)
289+
return self.run_code(refined_code), refined_code

0 commit comments

Comments
 (0)