zizytd commited on
Commit
a7268d5
1 Parent(s): feb2ea5

updating the app

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -131,14 +131,14 @@ def main():
131
  # except KeyError:
132
  # st.error(f"Unexpected response format. Missing 'response_text' key. Received: {response.text}")
133
 
134
- if prompt := st.chat_input("What is up?"):
135
- response = pipe(f"<s>[INST] {prompt} [/INST]")
136
- response_text = response[0]["generated_text"].replace("<s>[INST]", "").replace("[/INST]", "").strip()
137
-
138
- with st.chat_message("assistant"):
139
- st.markdown(response_text)
140
-
141
- st.session_state.messages.append({"role": "assistant", "content": response_text})
142
 
143
  # Save updated chat history
144
  user_data["chat_history"] = st.session_state.messages
 
131
  # except KeyError:
132
  # st.error(f"Unexpected response format. Missing 'response_text' key. Received: {response.text}")
133
 
134
+ if prompt := st.chat_input("What is up?"):
135
+ response = pipe(f"<s>[INST] {prompt} [/INST]")
136
+ response_text = response[0]["generated_text"].replace("<s>[INST]", "").replace("[/INST]", "").strip()
137
+
138
+ with st.chat_message("assistant"):
139
+ st.markdown(response_text)
140
+
141
+ st.session_state.messages.append({"role": "assistant", "content": response_text})
142
 
143
  # Save updated chat history
144
  user_data["chat_history"] = st.session_state.messages