Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -94,6 +94,17 @@ def cloud_button(label, key=None):
|
|
94 |
"""
|
95 |
st.markdown(cloud_button_html, unsafe_allow_html=True)
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
def load_pdf(file_path):
|
99 |
pdf_reader = PdfReader(file_path)
|
@@ -179,17 +190,17 @@ def main():
|
|
179 |
if pdf_path is not None:
|
180 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
181 |
|
182 |
-
if
|
183 |
query = "Was genau ist ein Belegarzt?"
|
184 |
-
if
|
185 |
query = "Wofür wird die Alpha-ID verwendet?"
|
186 |
-
if
|
187 |
query = "Was sind die Vorteile des ambulanten operierens?"
|
188 |
-
if
|
189 |
query = "Was kann ich mit dem Prognose-Analyse Toll machen?"
|
190 |
-
if
|
191 |
query = "Was sagt mir die Farbe der Balken der Bevölkerungsentwicklung?"
|
192 |
-
if
|
193 |
query = "Ich habe mein Meta Password vergessen, wie kann ich es zurücksetzen?"
|
194 |
|
195 |
if st.button("Ask") or (not st.session_state['chat_history'] and query) or (st.session_state['chat_history'] and query != st.session_state['chat_history'][-1][1]):
|
|
|
94 |
"""
|
95 |
st.markdown(cloud_button_html, unsafe_allow_html=True)
|
96 |
|
97 |
+
def spaced_cloud_button(label):
|
98 |
+
cloud_button_html = f"""
|
99 |
+
<div style="padding: 10px 10px 10px 0;">
|
100 |
+
"""
|
101 |
+
cloud_button_html += cloud_button(label)
|
102 |
+
cloud_button_html += """
|
103 |
+
</div>
|
104 |
+
"""
|
105 |
+
st.markdown(cloud_button_html, unsafe_allow_html=True)
|
106 |
+
|
107 |
+
|
108 |
|
109 |
def load_pdf(file_path):
|
110 |
pdf_reader = PdfReader(file_path)
|
|
|
190 |
if pdf_path is not None:
|
191 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
192 |
|
193 |
+
if spaced_cloud_button("Was genau ist ein Belegarzt?"):
|
194 |
query = "Was genau ist ein Belegarzt?"
|
195 |
+
if spaced_cloud_button("Wofür wird die Alpha-ID verwendet?"):
|
196 |
query = "Wofür wird die Alpha-ID verwendet?"
|
197 |
+
if spaced_cloud_button("Was sind die Vorteile des ambulanten operierens?"):
|
198 |
query = "Was sind die Vorteile des ambulanten operierens?"
|
199 |
+
if spaced_cloud_button("Was kann ich mit dem Prognose-Analyse Toll machen?"):
|
200 |
query = "Was kann ich mit dem Prognose-Analyse Toll machen?"
|
201 |
+
if spaced_cloud_button("Was sagt mir die Farbe der Balken der Bevölkerungsentwicklung?"):
|
202 |
query = "Was sagt mir die Farbe der Balken der Bevölkerungsentwicklung?"
|
203 |
+
if spaced_cloud_button("Ich habe mein Meta Password vergessen, wie kann ich es zurücksetzen?"):
|
204 |
query = "Ich habe mein Meta Password vergessen, wie kann ich es zurücksetzen?"
|
205 |
|
206 |
if st.button("Ask") or (not st.session_state['chat_history'] and query) or (st.session_state['chat_history'] and query != st.session_state['chat_history'][-1][1]):
|