Spaces:
Runtime error
Runtime error
adding rayan prompt
Browse files
app.py
CHANGED
|
@@ -534,20 +534,21 @@ if st.session_state.get('button') == True:
|
|
| 534 |
if(preference):
|
| 535 |
ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
|
| 536 |
st.markdown('##### Here is the recommended Generated Email for you:')
|
| 537 |
-
st.
|
|
|
|
| 538 |
else:
|
|
|
|
| 539 |
if(preference):
|
| 540 |
ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
|
| 541 |
email_body_opt=ai_generated_email
|
| 542 |
-
else:
|
| 543 |
-
email_body_opt=email_body
|
| 544 |
optimized_email, optimized_char_cnt, optimized_url_cnt = optimize_email_prompt_multi(email_body_opt, options)
|
| 545 |
charc, tmval=get_optimized_prediction("sagemakermodelcc", "modelCC.sav", "sagemakermodelcc", target, industry,
|
| 546 |
optimized_char_cnt, optimized_url_cnt, industry_code_dict)
|
| 547 |
st.markdown('##### Current Character Count in Your Optimized Email is: {}'.format(charc), unsafe_allow_html=True)
|
| 548 |
st.markdown('##### The model predicts that it achieves a {} of {}%'.format(target,tmval), unsafe_allow_html=True)
|
| 549 |
st.markdown('##### Here is the recommended Generated Email for you:')
|
| 550 |
-
st.
|
|
|
|
| 551 |
|
| 552 |
# st.session_state['button'] = False
|
| 553 |
# preference= "character counts: "+str(573)+", Target Rate: "+str(37.2)
|
|
|
|
| 534 |
if(preference):
|
| 535 |
ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
|
| 536 |
st.markdown('##### Here is the recommended Generated Email for you:')
|
| 537 |
+
with st.expander('', expanded=True):
|
| 538 |
+
st.markdown('{}:'.format(ai_generated_email),unsafe_allow_html=True)
|
| 539 |
else:
|
| 540 |
+
email_body_opt=email_body
|
| 541 |
if(preference):
|
| 542 |
ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
|
| 543 |
email_body_opt=ai_generated_email
|
|
|
|
|
|
|
| 544 |
optimized_email, optimized_char_cnt, optimized_url_cnt = optimize_email_prompt_multi(email_body_opt, options)
|
| 545 |
charc, tmval=get_optimized_prediction("sagemakermodelcc", "modelCC.sav", "sagemakermodelcc", target, industry,
|
| 546 |
optimized_char_cnt, optimized_url_cnt, industry_code_dict)
|
| 547 |
st.markdown('##### Current Character Count in Your Optimized Email is: {}'.format(charc), unsafe_allow_html=True)
|
| 548 |
st.markdown('##### The model predicts that it achieves a {} of {}%'.format(target,tmval), unsafe_allow_html=True)
|
| 549 |
st.markdown('##### Here is the recommended Generated Email for you:')
|
| 550 |
+
with st.expander('', expanded=True):
|
| 551 |
+
st.markdown('{}:'.format(optimized_email),unsafe_allow_html=True)
|
| 552 |
|
| 553 |
# st.session_state['button'] = False
|
| 554 |
# preference= "character counts: "+str(573)+", Target Rate: "+str(37.2)
|