Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,21 +47,12 @@ cloud_button_style = """
|
|
47 |
st.markdown(cloud_button_style, unsafe_allow_html=True)
|
48 |
|
49 |
def cloud_button(label, key):
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
# Check if the button was previously clicked
|
54 |
-
was_clicked = button_placeholder.button(label, key=key)
|
55 |
-
|
56 |
-
# If clicked, update the session state
|
57 |
-
if was_clicked:
|
58 |
st.session_state[key] = not st.session_state.get(key, False)
|
59 |
-
|
60 |
return st.session_state.get(key, False)
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
|
66 |
# Step 1: Clone the Dataset Repository
|
67 |
repo = Repository(
|
@@ -166,12 +157,18 @@ def main():
|
|
166 |
if pdf_path is not None:
|
167 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
168 |
|
169 |
-
# Use the cloud_button function for the custom styled buttons
|
170 |
if cloud_button("Was genau ist ein Belegarzt?", "belegarzt_button"):
|
171 |
query = "Was genau ist ein Belegarzt?"
|
|
|
172 |
|
173 |
if cloud_button("Wofür wird die Alpha-ID verwendet?", "alpha_id_button"):
|
174 |
query = "Wofür wird die Alpha-ID verwendet?"
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
# For default styled buttons, use st.button
|
177 |
if st.button("Was sind die Vorteile des ambulanten operierens?"):
|
|
|
47 |
st.markdown(cloud_button_style, unsafe_allow_html=True)
|
48 |
|
49 |
def cloud_button(label, key):
|
50 |
+
button_html = f'<button type="button" class="cloud-button">{label}</button>'
|
51 |
+
button_click = st.button(label, key=key, use_container_width=True)
|
52 |
+
if button_click:
|
|
|
|
|
|
|
|
|
|
|
53 |
st.session_state[key] = not st.session_state.get(key, False)
|
|
|
54 |
return st.session_state.get(key, False)
|
55 |
|
|
|
|
|
|
|
56 |
|
57 |
# Step 1: Clone the Dataset Repository
|
58 |
repo = Repository(
|
|
|
157 |
if pdf_path is not None:
|
158 |
query = st.text_input("Ask questions about your PDF file (in any preferred language):")
|
159 |
|
|
|
160 |
if cloud_button("Was genau ist ein Belegarzt?", "belegarzt_button"):
|
161 |
query = "Was genau ist ein Belegarzt?"
|
162 |
+
st.session_state["belegarzt_button"] = False # Reset the button state
|
163 |
|
164 |
if cloud_button("Wofür wird die Alpha-ID verwendet?", "alpha_id_button"):
|
165 |
query = "Wofür wird die Alpha-ID verwendet?"
|
166 |
+
st.session_state["alpha_id_button"] = False # Reset the button state
|
167 |
+
|
168 |
+
if st.button("Was sind die Vorteile des ambulanten operierens?"):
|
169 |
+
query = "Was sind die Vorteile des ambulanten operierens?"
|
170 |
+
|
171 |
+
|
172 |
|
173 |
# For default styled buttons, use st.button
|
174 |
if st.button("Was sind die Vorteile des ambulanten operierens?"):
|