Spaces:
Sleeping
Sleeping
# Import necessary libraries | |
import streamlit as st | |
from transformers import pipeline | |
# Initialize the chatbot model | |
chatbot = pipeline("text-generation", model="PAIXAI/Astrid-LLama-7B") | |
# Streamlit UI | |
st.title("Astrid-LLama-7B Chatbot") | |
# User input | |
user_input = st.text_input("You: ", "") | |
# Get response from the chatbot | |
if st.button("Ask"): | |
with st.spinner("Generating response..."): | |
response = chatbot(user_input, max_length=100, do_sample=True, top_p=0.95, top_k=60, trust_remote_code=True) | |
st.write("Bot:", response[0]['generated_text']) | |
st.sidebar.header("About") | |
st.sidebar.text("This is a simple chatbot using\n" | |
"the Astrid-LLama-7B model from\n" | |
"Hugging Face and Streamlit UI.") | |