File size: 520 Bytes
8bbfca2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
from transformers import pipeline

# Load the conversational pipeline
conversational_pipeline = pipeline("conversational")

# Streamlit app header
st.title("Hugging Face Conversational Model Demo")

# Input for user message
user_message = st.text_input("You:", "")

if st.button("Send"):
    # Get the model's response
    model_response = conversational_pipeline(user_message)[0]['generated_responses'][0]

    # Display the model's response
    st.text_area("Model:", model_response, height=100)