File size: 554 Bytes
4b34231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

# 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!")