cd14 commited on
Commit
a297cac
1 Parent(s): 29264ff

adding gen ai support

Browse files
Files changed (1) hide show
  1. app.py +18 -14
app.py CHANGED
@@ -498,25 +498,29 @@ if st.button('Generate Predictions'):
498
  st.write("\n")
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))
519
- # sorted_chars_out = sorted(chars_out.items(), key=lambda x: x[1], reverse=True)
520
 
521
 
522
  placeholder.empty()
 
498
  st.write("\n")
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
+ preference= "charcter counts: "+str(573)+", Target Rate: "+str(37.2)
 
 
 
 
 
 
 
 
 
 
 
502
  ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
503
  st.markdown('##### Here is the recommended Generated Email for you:')
504
  st.markdown('####### {}:'.format(ai_generated_email),unsafe_allow_html=True)
505
+ #st.write(np.array(chars))
506
+ # prefrence_variables=res=["charcter counts: "+str(x)+", Target Rate: "+str(y) for x,y in zip(chars,sel_var_values)]
507
+ # preference = st.selectbox(
508
+ # 'Please select your preferences',
509
+ # prefrence_variables,
510
+ # index=1
511
+ # )
512
+ # if(preference):
513
+ # if st.button('Generate AI Recommended Email'):
514
+ # if(preference is None):
515
+ # st.error('Please upload a email (HTML format)')
516
+ # else:
517
+ # ai_generated_email=generate_example_email_with_context(email_body, campaign, industry, target, sorted_chars_out, preference)
518
+ # st.markdown('##### Here is the recommended Generated Email for you:')
519
+ # st.markdown('####### {}:'.format(ai_generated_email),unsafe_allow_html=True)
520
 
521
 
522
+ chars_out = dict(zip(chars, sel_var_values))
523
+ sorted_chars_out = sorted(chars_out.items(), key=lambda x: x[1], reverse=True)
524
 
525
 
526
  placeholder.empty()