Pre-load page with a haiku
Browse files
app.py
CHANGED
@@ -33,9 +33,18 @@ and the underlying AI models.</small></p>
|
|
33 |
"""
|
34 |
st.markdown(footer, unsafe_allow_html=True)
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
poem = st.text_area(
|
37 |
-
f'''**Type or copy-paste a poem
|
38 |
-
''
|
|
|
39 |
)
|
40 |
|
41 |
if st.button('Generate image'):
|
|
|
33 |
"""
|
34 |
st.markdown(footer, unsafe_allow_html=True)
|
35 |
|
36 |
+
preload_text = ''
|
37 |
+
|
38 |
+
try:
|
39 |
+
with open('examples/old_pond.txt', 'r', encoding='utf8') as in_file:
|
40 |
+
preload_text = in_file.read().strip()
|
41 |
+
except Exception:
|
42 |
+
pass
|
43 |
+
|
44 |
poem = st.text_area(
|
45 |
+
f'''**Type or copy-paste a poem or start off with the following haiku
|
46 |
+
(max. {Config.LLM_MAX_INPUT_LENGTH} characters will be considered):**''',
|
47 |
+
preload_text
|
48 |
)
|
49 |
|
50 |
if st.button('Generate image'):
|