Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,8 @@ from langchain.memory import ConversationBufferMemory
|
|
| 28 |
from langchain.chains import ConversationalRetrievalChain
|
| 29 |
from templates import css, bot_template, user_template
|
| 30 |
|
| 31 |
-
# sidebar declares up front allow all other functions to see
|
|
|
|
| 32 |
should_save = st.sidebar.checkbox("💾 Save")
|
| 33 |
|
| 34 |
def generate_filename(prompt, file_type):
|
|
@@ -302,9 +303,7 @@ def divide_prompt(prompt, max_length):
|
|
| 302 |
return chunks
|
| 303 |
|
| 304 |
def main():
|
| 305 |
-
# Sidebar and global setup
|
| 306 |
openai.api_key = os.getenv('OPENAI_API_KEY')
|
| 307 |
-
st.set_page_config(page_title="GPT Streamlit Document Reasoner", layout="wide")
|
| 308 |
|
| 309 |
# File type for output, model choice
|
| 310 |
menu = ["txt", "htm", "xlsx", "csv", "md", "py"]
|
|
|
|
| 28 |
from langchain.chains import ConversationalRetrievalChain
|
| 29 |
from templates import css, bot_template, user_template
|
| 30 |
|
| 31 |
+
# page config and sidebar declares up front allow all other functions to see global class variables
|
| 32 |
+
st.set_page_config(page_title="GPT Streamlit Document Reasoner", layout="wide")
|
| 33 |
should_save = st.sidebar.checkbox("💾 Save")
|
| 34 |
|
| 35 |
def generate_filename(prompt, file_type):
|
|
|
|
| 303 |
return chunks
|
| 304 |
|
| 305 |
def main():
|
|
|
|
| 306 |
openai.api_key = os.getenv('OPENAI_API_KEY')
|
|
|
|
| 307 |
|
| 308 |
# File type for output, model choice
|
| 309 |
menu = ["txt", "htm", "xlsx", "csv", "md", "py"]
|