Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
106 |
instructions = "Respond as an expert doctor in diabetes. Ensure the response is informative and directly answers the user's question."
|
107 |
|
108 |
# Create the full prompt with instructions
|
109 |
-
full_prompt = f"<s>[INST] {
|
110 |
|
111 |
# Display assistant response in chat message container
|
112 |
with st.chat_message("assistant"):
|
@@ -120,8 +120,8 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
120 |
stream=True,
|
121 |
max_tokens=1024,
|
122 |
)
|
123 |
-
|
124 |
response = st.write_stream(stream)
|
|
|
|
|
125 |
st.session_state.messages.append(
|
126 |
-
{"role": "assistant", "content": response})
|
127 |
-
|
|
|
106 |
instructions = "Respond as an expert doctor in diabetes. Ensure the response is informative and directly answers the user's question."
|
107 |
|
108 |
# Create the full prompt with instructions
|
109 |
+
full_prompt = f"<s>[INST] {user_prompt} [/INST] {instructions}</s>"
|
110 |
|
111 |
# Display assistant response in chat message container
|
112 |
with st.chat_message("assistant"):
|
|
|
120 |
stream=True,
|
121 |
max_tokens=1024,
|
122 |
)
|
|
|
123 |
response = st.write_stream(stream)
|
124 |
+
# Remove the '</s>' from the response if it exists
|
125 |
+
response = response.replace('</s>', '').strip()
|
126 |
st.session_state.messages.append(
|
127 |
+
{"role": "assistant", "content": response})
|
|