Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,11 +29,11 @@ text = st.text_area("入力テキスト", default_text)
|
|
| 29 |
|
| 30 |
# 翻訳ボタンが押されたときの処理
|
| 31 |
if st.button("翻訳する"):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
result = st.session_state.session_models[model](text)[0]['translation_text']
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
-
output_col.write(f"翻訳結果: {result}")
|
| 37 |
-
|
| 38 |
-
# Experimental rerun without re-executing the entire app
|
| 39 |
-
st.experimental_rerun([output_col])
|
|
|
|
| 29 |
|
| 30 |
# 翻訳ボタンが押されたときの処理
|
| 31 |
if st.button("翻訳する"):
|
| 32 |
+
# Create an empty element for displaying the result
|
| 33 |
+
result_container = st.empty()
|
| 34 |
+
|
| 35 |
+
# Perform translation
|
| 36 |
result = st.session_state.session_models[model](text)[0]['translation_text']
|
| 37 |
|
| 38 |
+
# Update the result_container with the translated text
|
| 39 |
+
result_container.write(f"翻訳結果: {result}")
|
|
|
|
|
|
|
|
|
|
|
|