cd14 commited on
Commit
0e67d14
1 Parent(s): a297cac

adding gen ai support

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. utils.py +1 -0
app.py CHANGED
@@ -500,8 +500,9 @@ if st.button('Generate Predictions'):
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(
 
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
+ print("ai_generated_email: ",ai_generated_email)
504
  st.markdown('##### Here is the recommended Generated Email for you:')
505
+ st.markdown('####### {}'.format(ai_generated_email),unsafe_allow_html=True)
506
  #st.write(np.array(chars))
507
  # prefrence_variables=res=["charcter counts: "+str(x)+", Target Rate: "+str(y) for x,y in zip(chars,sel_var_values)]
508
  # preference = st.selectbox(
utils.py CHANGED
@@ -24,6 +24,7 @@ def chat_gpt_user_input_loop():
24
 
25
 
26
  def generate_example_email_with_context(email_body, selected_campaign_type, selected_industry, selected_variable, chars_out, dropdown_cc):
 
27
  if len(chars_out) == 1:
28
  if str(chars_out[0][0]) in dropdown_cc:
29
  generate_email_prompt = "Rewrite this email keeping relevant information (people, date, location): " + email_body + "." "Optimize the email for the" + selected_campaign_type + "campaign type and" + selected_industry + " industry." + "The email body should be around" + str(chars_out[0][0]+200) + "characters in length."
 
24
 
25
 
26
  def generate_example_email_with_context(email_body, selected_campaign_type, selected_industry, selected_variable, chars_out, dropdown_cc):
27
+ print("I am here!")
28
  if len(chars_out) == 1:
29
  if str(chars_out[0][0]) in dropdown_cc:
30
  generate_email_prompt = "Rewrite this email keeping relevant information (people, date, location): " + email_body + "." "Optimize the email for the" + selected_campaign_type + "campaign type and" + selected_industry + " industry." + "The email body should be around" + str(chars_out[0][0]+200) + "characters in length."