Spaces:
Running
Running
Update UI
Browse files- app.py +12 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -2,6 +2,9 @@ import os
|
|
2 |
import tempfile
|
3 |
|
4 |
import streamlit as st
|
|
|
|
|
|
|
5 |
from langchain.callbacks.base import BaseCallbackHandler
|
6 |
from langchain.chains import ConversationalRetrievalChain
|
7 |
from langchain.chat_models import ChatOpenAI
|
@@ -13,8 +16,14 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
13 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
14 |
|
15 |
st.set_page_config(page_title="π InkChatGPT: Chat with Documents", page_icon="π")
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
@st.cache_resource(ttl="1h")
|
20 |
def configure_retriever(uploaded_files):
|
@@ -81,6 +90,7 @@ class PrintRetrievalHandler(BaseCallbackHandler):
|
|
81 |
|
82 |
|
83 |
openai_api_key = st.sidebar.text_input("OpenAI API Key", type="password")
|
|
|
84 |
if not openai_api_key:
|
85 |
st.info("Please add your OpenAI API key to continue.")
|
86 |
st.stop()
|
|
|
2 |
import tempfile
|
3 |
|
4 |
import streamlit as st
|
5 |
+
from streamlit_extras.add_vertical_space import add_vertical_space
|
6 |
+
from streamlit_extras.colored_header import colored_header
|
7 |
+
|
8 |
from langchain.callbacks.base import BaseCallbackHandler
|
9 |
from langchain.chains import ConversationalRetrievalChain
|
10 |
from langchain.chat_models import ChatOpenAI
|
|
|
16 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
17 |
|
18 |
st.set_page_config(page_title="π InkChatGPT: Chat with Documents", page_icon="π")
|
19 |
+
|
20 |
+
add_vertical_space(30)
|
21 |
+
colored_header(
|
22 |
+
label="π InkChatGPT",
|
23 |
+
description="Chat with Documents",
|
24 |
+
color_name="light-blue-70",
|
25 |
+
)
|
26 |
+
|
27 |
|
28 |
@st.cache_resource(ttl="1h")
|
29 |
def configure_retriever(uploaded_files):
|
|
|
90 |
|
91 |
|
92 |
openai_api_key = st.sidebar.text_input("OpenAI API Key", type="password")
|
93 |
+
|
94 |
if not openai_api_key:
|
95 |
st.info("Please add your OpenAI API key to continue.")
|
96 |
st.stop()
|
requirements.txt
CHANGED
@@ -4,4 +4,5 @@ docarray
|
|
4 |
langchain
|
5 |
streamlit
|
6 |
streamlit_chat
|
|
|
7 |
pypdf
|
|
|
4 |
langchain
|
5 |
streamlit
|
6 |
streamlit_chat
|
7 |
+
streamlit-extras
|
8 |
pypdf
|