Spaces:
Sleeping
Sleeping
Update chat
Browse files- app.py +4 -8
- requirements.txt +1 -2
app.py
CHANGED
@@ -8,11 +8,6 @@ from langchain_community.document_loaders import Docx2txtLoader, PyPDFLoader, Te
|
|
8 |
from langchain_community.vectorstores.chroma import Chroma
|
9 |
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
|
10 |
|
11 |
-
__import__("pysqlite3")
|
12 |
-
import sys
|
13 |
-
|
14 |
-
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")
|
15 |
-
|
16 |
st.set_page_config(page_title="InkChatGPT", page_icon="π")
|
17 |
|
18 |
|
@@ -79,11 +74,13 @@ def main():
|
|
79 |
The main function that runs the Streamlit app.
|
80 |
"""
|
81 |
|
82 |
-
|
83 |
st.session_state["messages"] = [
|
84 |
-
ChatMessage(role="assistant", content=
|
85 |
]
|
86 |
|
|
|
|
|
87 |
if prompt := st.chat_input(
|
88 |
placeholder="Chat with your document",
|
89 |
disabled=(not st.session_state.api_key),
|
@@ -157,7 +154,6 @@ def clear_history():
|
|
157 |
def build_sidebar():
|
158 |
with st.sidebar:
|
159 |
st.title("π InkChatGPT")
|
160 |
-
st.write("Upload a document and ask questions related to its content.")
|
161 |
|
162 |
openai_api_key = st.text_input(
|
163 |
"OpenAI API Key", type="password", placeholder="Enter your OpenAI API key"
|
|
|
8 |
from langchain_community.vectorstores.chroma import Chroma
|
9 |
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
st.set_page_config(page_title="InkChatGPT", page_icon="π")
|
12 |
|
13 |
|
|
|
74 |
The main function that runs the Streamlit app.
|
75 |
"""
|
76 |
|
77 |
+
assistant_message = "Hello, you can upload a document and chat with me to ask questions related to its content."
|
78 |
st.session_state["messages"] = [
|
79 |
+
ChatMessage(role="assistant", content=assistant_message)
|
80 |
]
|
81 |
|
82 |
+
st.chat_message("assistant").write(assistant_message)
|
83 |
+
|
84 |
if prompt := st.chat_input(
|
85 |
placeholder="Chat with your document",
|
86 |
disabled=(not st.session_state.api_key),
|
|
|
154 |
def build_sidebar():
|
155 |
with st.sidebar:
|
156 |
st.title("π InkChatGPT")
|
|
|
157 |
|
158 |
openai_api_key = st.text_input(
|
159 |
"OpenAI API Key", type="password", placeholder="Enter your OpenAI API key"
|
requirements.txt
CHANGED
@@ -7,5 +7,4 @@ openai
|
|
7 |
tiktoken
|
8 |
pypdf
|
9 |
docx2txt
|
10 |
-
watchdog
|
11 |
-
pysqlite3-binary
|
|
|
7 |
tiktoken
|
8 |
pypdf
|
9 |
docx2txt
|
10 |
+
watchdog
|
|