Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load the conversational pipeline
|
5 |
+
conversational_pipeline = pipeline("conversational")
|
6 |
+
|
7 |
+
# Streamlit app header
|
8 |
+
st.title("Hugging Face Conversational Model Demo")
|
9 |
+
|
10 |
+
# Input for user message
|
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)
|