Grey01 commited on
Commit
9b65a20
·
verified ·
1 Parent(s): 6620aea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -38,19 +38,19 @@ user_input = st.chat_input("Ask Digital Ink..")
38
 
39
  if user_input:
40
  # Add user message to chat history
41
- st.session_state.messages.append({"role": "system", "content": "You are a helpful assistant named Digital Ink. Your purpose is to provide creative engaging and effective marketing content.You can introduce your self as follows: I'm Digital Ink, a marketing content generation model. I'm designed to assist you in creating engaging and effective marketing content, such as blog posts, social media posts, and product descriptions"})
42
- st.session_state.messages.append({"role": "user", "content": user_input})
43
  st.chat_state.chat_message("user").markdown(user_input)
44
 
45
  # Generate response from chatbot
46
  context = [msg['content'] for msg in st.session_state.messages]
47
- messages = [
48
  {"role": "system", "content": "You are a helpful assistant named Digital Ink. Your purpose is to provide creative engaging and effective marketing content.You can introduce your self as follows: I'm Digital Ink, a marketing content generation model. I'm designed to assist you in creating engaging and effective marketing content, such as blog posts, social media posts, and product descriptions"},
49
  {"role": "user", "content": user_input},
50
  {"role": "assistant", "content": ""},
51
  {"role": "user", "content": ""},
52
  ]
53
- response = chat_pipeline(messages, **generation_args)[0]['generated_text']
54
 
55
  # Add assistant response to chat history
56
  st.session_state.messages.append({"role": "assistant", "content": response})
 
38
 
39
  if user_input:
40
  # Add user message to chat history
41
+ st.session_state.message.append({"role": "system", "content": "You are a helpful assistant named Digital Ink. Your purpose is to provide creative engaging and effective marketing content.You can introduce your self as follows: I'm Digital Ink, a marketing content generation model. I'm designed to assist you in creating engaging and effective marketing content, such as blog posts, social media posts, and product descriptions"})
42
+ st.session_state.message.append({"role": "user", "content": user_input})
43
  st.chat_state.chat_message("user").markdown(user_input)
44
 
45
  # Generate response from chatbot
46
  context = [msg['content'] for msg in st.session_state.messages]
47
+ message = [
48
  {"role": "system", "content": "You are a helpful assistant named Digital Ink. Your purpose is to provide creative engaging and effective marketing content.You can introduce your self as follows: I'm Digital Ink, a marketing content generation model. I'm designed to assist you in creating engaging and effective marketing content, such as blog posts, social media posts, and product descriptions"},
49
  {"role": "user", "content": user_input},
50
  {"role": "assistant", "content": ""},
51
  {"role": "user", "content": ""},
52
  ]
53
+ response = chat_pipeline(message, **generation_args)[0]['generated_text']
54
 
55
  # Add assistant response to chat history
56
  st.session_state.messages.append({"role": "assistant", "content": response})