Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import pipeline | |
# Initialize the text generation pipeline | |
pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3.1-8B") | |
# Streamlit app | |
st.title("Meta-Llama Chatbot") | |
st.write("Welcome to the Meta-Llama-3.1-8B chatbot!") | |
user_input = st.text_input("You: ", "Hello!") | |
if user_input: | |
with st.spinner("Generating response..."): | |
response = pipe(user_input, max_length=100, num_return_sequences=1)[0]['generated_text'] | |
st.write(f"Bot: {response}") | |
st.write("Have a great conversation!") | |