Spaces:
Sleeping
Sleeping
Update pages/ChatterBot.py
Browse files- pages/ChatterBot.py +9 -0
pages/ChatterBot.py
CHANGED
|
@@ -1,8 +1,17 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from streamlit_chat import message
|
| 3 |
from langchain import OpenAI
|
| 4 |
from langchain.chains import LLMChain, ConversationChain
|
| 5 |
from langchain.chains.conversation.memory import (ConversationBufferMemory, ConversationSummaryMemory, ConversationBufferWindowMemory)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
if 'conversation' not in st.session_state:
|
| 8 |
st.session_state['conversation'] =None
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import transformers
|
| 3 |
from streamlit_chat import message
|
| 4 |
from langchain import OpenAI
|
| 5 |
from langchain.chains import LLMChain, ConversationChain
|
| 6 |
from langchain.chains.conversation.memory import (ConversationBufferMemory, ConversationSummaryMemory, ConversationBufferWindowMemory)
|
| 7 |
+
# Use a pipeline as a high-level helper
|
| 8 |
+
from transformers import pipeline
|
| 9 |
+
|
| 10 |
+
pipe = pipeline("text-generation", model="MaziyarPanahi/BASH-Coder-Mistral-7B-Mistral-7B-Instruct-v0.2-slerp-GGUF")
|
| 11 |
+
|
| 12 |
+
Copy
|
| 13 |
+
|
| 14 |
+
|
| 15 |
|
| 16 |
if 'conversation' not in st.session_state:
|
| 17 |
st.session_state['conversation'] =None
|