Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def generate_reminder(language, feeling, reason, plan):
|
|
32 |
- Feeling: {feeling}.
|
33 |
- Reason for the feeling: {reason}.
|
34 |
- Plan for the day: {plan}.
|
35 |
-
- Explain within 100 words in English, or 200
|
36 |
"""
|
37 |
with st.spinner('Generating your daily reminder...'):
|
38 |
response = openai.ChatCompletion.create(
|
@@ -46,17 +46,11 @@ def generate_reminder(language, feeling, reason, plan):
|
|
46 |
return None
|
47 |
|
48 |
# Determine button text based on current language
|
49 |
-
if st.session_state['language'] == 'English'
|
50 |
-
switch_button_text = 'Switch Language to Japanese'
|
51 |
-
else:
|
52 |
-
switch_button_text = 'Switch Language to English'
|
53 |
|
54 |
# Language switcher button
|
55 |
if st.button(switch_button_text):
|
56 |
-
if st.session_state['language'] == 'English'
|
57 |
-
st.session_state['language'] = 'Japanese'
|
58 |
-
else:
|
59 |
-
st.session_state['language'] = 'English'
|
60 |
st.experimental_rerun()
|
61 |
|
62 |
# Display form based on selected language
|
|
|
32 |
- Feeling: {feeling}.
|
33 |
- Reason for the feeling: {reason}.
|
34 |
- Plan for the day: {plan}.
|
35 |
+
- Explain within 100 words in English, or 200 characters in Japanese.
|
36 |
"""
|
37 |
with st.spinner('Generating your daily reminder...'):
|
38 |
response = openai.ChatCompletion.create(
|
|
|
46 |
return None
|
47 |
|
48 |
# Determine button text based on current language
|
49 |
+
switch_button_text = 'Switch Language to Japanese' if st.session_state['language'] == 'English' else 'Switch Language to English'
|
|
|
|
|
|
|
50 |
|
51 |
# Language switcher button
|
52 |
if st.button(switch_button_text):
|
53 |
+
st.session_state['language'] = 'Japanese' if st.session_state['language'] == 'English' else 'English'
|
|
|
|
|
|
|
54 |
st.experimental_rerun()
|
55 |
|
56 |
# Display form based on selected language
|