OzoneAsai commited on
Commit
1303530
·
1 Parent(s): cd384ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- # Outputをcollumまたはcontainerに格納
35
- output_col, _ = st.columns(2)
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}")