Spaces:
Build error
Build error
Bahareh Kavousi nejad
commited on
Commit
·
a1e73e9
1
Parent(s):
d6f1e5a
From the beginning :_)
Browse files
app.py
CHANGED
|
@@ -1,18 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
# Load
|
| 5 |
-
chatbot = pipeline("text-generation", model="
|
| 6 |
|
| 7 |
-
# Streamlit app
|
| 8 |
-
st.title("Chat with LLM")
|
| 9 |
-
|
| 10 |
-
user_input = st.text_input("You: ", placeholder="Type your message here...")
|
| 11 |
|
| 12 |
if st.button("Send"):
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
response = chatbot(user_input, max_length=100, num_return_sequences=1)
|
| 16 |
-
st.text_area("AI:", value=response[0]["generated_text"], height=200, max_chars=None)
|
| 17 |
-
else:
|
| 18 |
-
st.warning("Please enter a valid input.")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load the model
|
| 5 |
+
chatbot = pipeline("text-generation", model="EleutherAI/gpt-neo-1.3B")
|
| 6 |
|
| 7 |
+
# Streamlit app
|
| 8 |
+
st.title("Chat with an LLM")
|
| 9 |
+
user_input = st.text_input("Your Message:")
|
|
|
|
| 10 |
|
| 11 |
if st.button("Send"):
|
| 12 |
+
response = chatbot(user_input, max_length=100, do_sample=True)
|
| 13 |
+
st.text_area("LLM Response:", response[0]["generated_text"], height=200)
|
|
|
|
|
|
|
|
|
|
|
|