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