Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,12 @@ from langchain.chains.question_answering import load_qa_chain
|
|
| 15 |
from langchain.callbacks import get_openai_callback
|
| 16 |
import os
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# Step 1: Clone the Dataset Repository
|
| 19 |
repo = Repository(
|
| 20 |
local_dir="Private_Book", # Local directory to clone the repository
|
|
@@ -97,9 +103,19 @@ def main():
|
|
| 97 |
"""
|
| 98 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 99 |
|
| 100 |
-
|
| 101 |
-
st.
|
|
|
|
|
|
|
|
|
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
# Start tracking user interactions
|
| 105 |
with streamlit_analytics.track():
|
|
@@ -122,19 +138,29 @@ def main():
|
|
| 122 |
new_messages_placeholder = st.empty()
|
| 123 |
|
| 124 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
if query:
|
| 140 |
st.session_state['chat_history'].append(("User", query, "new"))
|
|
|
|
| 15 |
from langchain.callbacks import get_openai_callback
|
| 16 |
import os
|
| 17 |
|
| 18 |
+
#st.set_page_config(layout="wide")
|
| 19 |
+
st.set_option('theme', 'light')
|
| 20 |
+
|
| 21 |
+
# Set the page config to make the sidebar start in the collapsed state
|
| 22 |
+
st.set_page_config(initial_sidebar_state="collapsed")
|
| 23 |
+
|
| 24 |
# Step 1: Clone the Dataset Repository
|
| 25 |
repo = Repository(
|
| 26 |
local_dir="Private_Book", # Local directory to clone the repository
|
|
|
|
| 103 |
"""
|
| 104 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 105 |
|
| 106 |
+
# Create columns for layout
|
| 107 |
+
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 108 |
+
|
| 109 |
+
with col1:
|
| 110 |
+
st.title("Welcome to BinDocs ChatBot!")
|
| 111 |
|
| 112 |
+
with col2:
|
| 113 |
+
# Load and display the image in the right column, which will be the top-right corner of the page
|
| 114 |
+
image = Image.open('BinDoc Logo (Quadratisch).png')
|
| 115 |
+
st.image(image, use_column_width='always')
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
|
| 119 |
|
| 120 |
# Start tracking user interactions
|
| 121 |
with streamlit_analytics.track():
|
|
|
|
| 138 |
new_messages_placeholder = st.empty()
|
| 139 |
|
| 140 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
| 141 |
+
|
| 142 |
+
add_vertical_space(2) # Adjust as per the desired spacing
|
| 143 |
+
|
| 144 |
+
# Create two columns for the buttons
|
| 145 |
+
col1, col2 = st.columns(2)
|
| 146 |
|
| 147 |
+
with col1:
|
| 148 |
+
if st.button("Was kann ich mit dem Prognose-Analyse-Tool machen?"):
|
| 149 |
+
query = "Was kann ich mit dem Prognose-Analyse-Tool machen?"
|
| 150 |
+
if st.button("Was sagt mir die Farbe der Balken der Bevölkerungsentwicklung?"):
|
| 151 |
+
query = "Was sagt mir die Farbe der Balken der Bevölkerungsentwicklung?"
|
| 152 |
+
if st.button("Ich habe mein Meta-Password vergessen, wie kann ich es zurücksetzen?"):
|
| 153 |
+
query = "Ich habe mein Meta-Password vergessen, wie kann ich es zurücksetzen?"
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
with col2:
|
| 157 |
+
if st.button("Dies ist eine reine Test Frage, welche aber eine ausreichende Länge hat."):
|
| 158 |
+
query = "Dies ist eine reine Test Frage, welche aber eine ausreichende Länge hat."
|
| 159 |
+
if st.button("Was sagt mir denn generell die wundervolle Bevölkerungsentwicklung?"):
|
| 160 |
+
query = "Was sagt mir denn generell die wundervolle Bevölkerungsentwicklung?"
|
| 161 |
+
if st.button("Ob ich hier wohl viel schreibe, dass die Fragen vom Layout her passen?"):
|
| 162 |
+
query = "Ob ich hier wohl viel schreibe, dass die Fragen vom Layout her passen?"
|
| 163 |
+
|
| 164 |
|
| 165 |
if query:
|
| 166 |
st.session_state['chat_history'].append(("User", query, "new"))
|