Spaces:
Runtime error
Runtime error
adding gen ai support
Browse files
app.py
CHANGED
|
@@ -499,20 +499,20 @@ if st.button('Generate Predictions'):
|
|
| 499 |
chars_out = dict(zip(chars, sel_var_values))
|
| 500 |
sorted_chars_out = sorted(chars_out.items(), key=lambda x: x[1], reverse=True)
|
| 501 |
#st.write(np.array(chars))
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
|
| 517 |
|
| 518 |
# chars_out = dict(zip(chars, sel_var_values))
|
|
|
|
| 499 |
chars_out = dict(zip(chars, sel_var_values))
|
| 500 |
sorted_chars_out = sorted(chars_out.items(), key=lambda x: x[1], reverse=True)
|
| 501 |
#st.write(np.array(chars))
|
| 502 |
+
prefrence_variables=res=["charcter counts: "+str(x)+", Target Rate: "+str(y) for x,y in zip(chars,sel_var_values)]
|
| 503 |
+
preference = st.selectbox(
|
| 504 |
+
'Please select your preferences',
|
| 505 |
+
prefrence_variables,
|
| 506 |
+
index=1
|
| 507 |
+
)
|
| 508 |
+
# if(preference):
|
| 509 |
+
if st.button('Generate AI Recommended Email'):
|
| 510 |
+
if(preference is None):
|
| 511 |
+
st.error('Please upload a email (HTML format)')
|
| 512 |
+
else:
|
| 513 |
+
ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
|
| 514 |
+
st.markdown('##### Here is the recommended Generated Email for you:')
|
| 515 |
+
st.markdown('####### {}:'.format(ai_generated_email),unsafe_allow_html=True)
|
| 516 |
|
| 517 |
|
| 518 |
# chars_out = dict(zip(chars, sel_var_values))
|