Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,21 @@ from transformers import pipeline
|
|
| 9 |
import ast
|
| 10 |
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
################ STATEMENT SUMMARIZATION #################
|
| 13 |
|
| 14 |
# Load the summarization model
|
|
|
|
| 9 |
import ast
|
| 10 |
|
| 11 |
|
| 12 |
+
################ CHAT BOT #################
|
| 13 |
+
|
| 14 |
+
# Load the GPT model
|
| 15 |
+
generator = pipeline("text-generation", model="EleutherAI/gpt-neo-2.7B")
|
| 16 |
+
|
| 17 |
+
# Streamlit chat UI
|
| 18 |
+
st.title("GPT-3 Chatbox")
|
| 19 |
+
|
| 20 |
+
user_input = st.text_input("You: ", "Hello, how are you?")
|
| 21 |
+
|
| 22 |
+
if user_input:
|
| 23 |
+
response = generator(user_input, max_length=100, num_return_sequences=1)[0]['generated_text']
|
| 24 |
+
st.write(f"GPT-3: {response}")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
################ STATEMENT SUMMARIZATION #################
|
| 28 |
|
| 29 |
# Load the summarization model
|