Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
42 |
-
st.session_state.
|
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 |
-
|
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(
|
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})
|