Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,25 +13,25 @@ if 'question' not in st.session_state:
|
|
13 |
st.session_state['options'] = ""
|
14 |
|
15 |
def button1_callback():
|
16 |
-
st.session_state['context'] = "Konteks"
|
17 |
-
st.session_state['question'] = "Pertanyaan"
|
18 |
|
19 |
def button2_callback():
|
20 |
-
st.session_state['context'] = "Konteks"
|
21 |
-
st.session_state['question'] = "Pertanyaan"
|
22 |
|
23 |
|
24 |
|
25 |
st.caption('_Examples_')
|
26 |
-
st.button('
|
27 |
-
st.button('
|
28 |
|
29 |
context_placeholder = st.empty()
|
30 |
with context_placeholder:
|
31 |
context = st.text_area('Enter context: ', key = 'context')
|
32 |
|
33 |
question_placeholder = st.empty()
|
34 |
-
with question_placeholder
|
35 |
question = st.text_area('Enter question: ', key = 'question')
|
36 |
|
37 |
if text:
|
|
|
13 |
st.session_state['options'] = ""
|
14 |
|
15 |
def button1_callback():
|
16 |
+
st.session_state['context'] = "Konteks 1"
|
17 |
+
st.session_state['question'] = "Pertanyaan 1"
|
18 |
|
19 |
def button2_callback():
|
20 |
+
st.session_state['context'] = "Konteks 2"
|
21 |
+
st.session_state['question'] = "Pertanyaan 2"
|
22 |
|
23 |
|
24 |
|
25 |
st.caption('_Examples_')
|
26 |
+
st.button('Example 1', use_container_width=True, on_click = button1_callback)
|
27 |
+
st.button('Example 2', use_container_width=True, on_click = button2_callback)
|
28 |
|
29 |
context_placeholder = st.empty()
|
30 |
with context_placeholder:
|
31 |
context = st.text_area('Enter context: ', key = 'context')
|
32 |
|
33 |
question_placeholder = st.empty()
|
34 |
+
with question_placeholder:
|
35 |
question = st.text_area('Enter question: ', key = 'question')
|
36 |
|
37 |
if text:
|