Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Initialize the text generation pipeline
|
5 |
+
pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3.1-8B")
|
6 |
+
|
7 |
+
# Streamlit app
|
8 |
+
st.title("Meta-Llama Chatbot")
|
9 |
+
st.write("Welcome to the Meta-Llama-3.1-8B chatbot!")
|
10 |
+
|
11 |
+
user_input = st.text_input("You: ", "Hello!")
|
12 |
+
if user_input:
|
13 |
+
with st.spinner("Generating response..."):
|
14 |
+
response = pipe(user_input, max_length=100, num_return_sequences=1)[0]['generated_text']
|
15 |
+
st.write(f"Bot: {response}")
|
16 |
+
|
17 |
+
st.write("Have a great conversation!")
|