Spaces:
Build error
Build error
improving app default values
Browse files
app.py
CHANGED
@@ -97,10 +97,13 @@ def main():
|
|
97 |
on_change=company_type_changed,
|
98 |
)
|
99 |
|
|
|
|
|
|
|
100 |
email_offer = st.sidebar.text_area(
|
101 |
label="Offer description",
|
102 |
key="offer",
|
103 |
-
value=
|
104 |
height=200,
|
105 |
)
|
106 |
|
@@ -122,7 +125,7 @@ def main():
|
|
122 |
)
|
123 |
|
124 |
with st.form(key="form"):
|
125 |
-
if st.form_submit_button(label='Generate email', disabled=len(prompt_input) == 0):
|
126 |
with st.spinner("Generating email..."):
|
127 |
output = generate_email(prompt_input, max_tokens=max_tokens_input)
|
128 |
st.markdown("----")
|
|
|
97 |
on_change=company_type_changed,
|
98 |
)
|
99 |
|
100 |
+
if 'offer' not in st.session_state:
|
101 |
+
st.session_state['offer'] = choice(EXAMPLE_OFFERS.get(email_company_type))
|
102 |
+
|
103 |
email_offer = st.sidebar.text_area(
|
104 |
label="Offer description",
|
105 |
key="offer",
|
106 |
+
value=st.session_state['offer'],
|
107 |
height=200,
|
108 |
)
|
109 |
|
|
|
125 |
)
|
126 |
|
127 |
with st.form(key="form"):
|
128 |
+
if st.form_submit_button(label='Generate email', disabled=prompt_input is None or len(prompt_input) == 0):
|
129 |
with st.spinner("Generating email..."):
|
130 |
output = generate_email(prompt_input, max_tokens=max_tokens_input)
|
131 |
st.markdown("----")
|