iclalcetin's picture
Create app.py
4b34231 verified
raw
history blame contribute delete
554 Bytes
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!")