JamalAG commited on
Commit
a5a0bc7
·
1 Parent(s): 1ff70c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -11,8 +11,12 @@ st.title("Hugging Face Conversational Model Demo")
11
  user_message = st.text_input("You:", "")
12
 
13
  if st.button("Send"):
 
 
 
 
14
  # Get the model's response
15
- model_response = conversational_pipeline(user_message)[0]['generated_responses'][0]
16
 
17
  # Display the model's response
18
  st.text_area("Model:", model_response, height=100)
 
11
  user_message = st.text_input("You:", "")
12
 
13
  if st.button("Send"):
14
+ # Format the conversation for the conversational pipeline
15
+ conversation_history = [{"role": "system", "content": "You are a helpful assistant."},
16
+ {"role": "user", "content": user_message}]
17
+
18
  # Get the model's response
19
+ model_response = conversational_pipeline(conversation_history)[0]['generated_responses'][0]
20
 
21
  # Display the model's response
22
  st.text_area("Model:", model_response, height=100)