Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,15 +18,18 @@ generation_args = {
|
|
18 |
# Initialize the model pipeline
|
19 |
chat_pipeline = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct")
|
20 |
|
21 |
-
# Define system content
|
22 |
-
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"
|
23 |
|
24 |
# Streamlit app
|
25 |
st.title("Digital Ink")
|
26 |
|
27 |
# Initialize the chat history
|
28 |
-
if '
|
29 |
-
st.session_state.
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
|
@@ -35,6 +38,7 @@ user_input = st.chat_input("Ask Digital Ink..")
|
|
35 |
|
36 |
if user_input:
|
37 |
# Add user message to chat history
|
|
|
38 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
39 |
st.chat_state.chat_message("user").markdown(user_input)
|
40 |
|
|
|
18 |
# Initialize the model pipeline
|
19 |
chat_pipeline = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct")
|
20 |
|
|
|
|
|
21 |
|
22 |
# Streamlit app
|
23 |
st.title("Digital Ink")
|
24 |
|
25 |
# Initialize the chat history
|
26 |
+
if 'chat_history' not in st.session_state:
|
27 |
+
st.session_state.chat_history = []
|
28 |
+
|
29 |
+
#display chat history
|
30 |
+
for message in st.session_state.chat_history:
|
31 |
+
with st.chat_message(message["role"]):
|
32 |
+
st.markdown(message["content"])
|
33 |
|
34 |
|
35 |
|
|
|
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 |
|