Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,18 +82,16 @@ def wrap_text(text, max_length=40):
|
|
| 82 |
st.header("[μμμ§λ‘ν΅] μ½μ¬μ κΈΈ, \n μ€μ μ½μ¬μ μΈν°λ·° λ΄μ©μ κΈ°λ°μΌλ‘ μ§λ‘ μλ΄μ ν΄λ³΄μΈμ")
|
| 83 |
st.markdown("[copyright](https://www.youtube.com/@conanssam)")
|
| 84 |
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
if st.session_state['chat_history']:
|
| 87 |
for i in range(len(st.session_state['chat_history'])-1, -1, -1):
|
| 88 |
message(st.session_state['chat_history'][i]['User'], is_user=True, key=str(i) + '_user')
|
| 89 |
bot_reply = st.session_state['chat_history'][i]['Bot']
|
| 90 |
message(wrap_text("Bot: " + bot_reply), key=str(i))
|
| 91 |
|
| 92 |
-
# Then display the input form
|
| 93 |
-
with st.form('form', clear_on_submit=True):
|
| 94 |
-
user_input = st.text_input('You: ', '', key='input')
|
| 95 |
-
submitted = st.form_submit_button('Send')
|
| 96 |
-
|
| 97 |
if submitted and user_input:
|
| 98 |
placeholder = st.empty()
|
| 99 |
placeholder.text('μλ΅μ μμ±μ€μ
λλ€...')
|
|
@@ -106,5 +104,3 @@ if submitted and user_input:
|
|
| 106 |
for i in range(len(output)):
|
| 107 |
new_placeholder.text(wrap_text("Bot: " + output[:i+1]))
|
| 108 |
time.sleep(0.05)
|
| 109 |
-
|
| 110 |
-
|
|
|
|
| 82 |
st.header("[μμμ§λ‘ν΅] μ½μ¬μ κΈΈ, \n μ€μ μ½μ¬μ μΈν°λ·° λ΄μ©μ κΈ°λ°μΌλ‘ μ§λ‘ μλ΄μ ν΄λ³΄μΈμ")
|
| 83 |
st.markdown("[copyright](https://www.youtube.com/@conanssam)")
|
| 84 |
|
| 85 |
+
with st.form('form', clear_on_submit=True):
|
| 86 |
+
user_input = st.text_input('You: ', '', key='input')
|
| 87 |
+
submitted = st.form_submit_button('Send')
|
| 88 |
+
|
| 89 |
if st.session_state['chat_history']:
|
| 90 |
for i in range(len(st.session_state['chat_history'])-1, -1, -1):
|
| 91 |
message(st.session_state['chat_history'][i]['User'], is_user=True, key=str(i) + '_user')
|
| 92 |
bot_reply = st.session_state['chat_history'][i]['Bot']
|
| 93 |
message(wrap_text("Bot: " + bot_reply), key=str(i))
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
if submitted and user_input:
|
| 96 |
placeholder = st.empty()
|
| 97 |
placeholder.text('μλ΅μ μμ±μ€μ
λλ€...')
|
|
|
|
| 104 |
for i in range(len(output)):
|
| 105 |
new_placeholder.text(wrap_text("Bot: " + output[:i+1]))
|
| 106 |
time.sleep(0.05)
|
|
|
|
|
|