Aye10032
commited on
Commit
·
89654e5
1
Parent(s):
460b909
添加复制块
Browse files
pages/AcademicTranslate.py
CHANGED
@@ -26,7 +26,11 @@ with st.sidebar:
|
|
26 |
if 'ac_translate_history' not in st.session_state:
|
27 |
st.session_state.ac_translate_history = []
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
with chat_container:
|
32 |
for message in st.session_state.ac_translate_history:
|
@@ -78,3 +82,4 @@ if prompt := st.chat_input():
|
|
78 |
response = ac_translate(prompt, st.session_state.get('is_en2zh'))
|
79 |
translate_result = chat_container.chat_message("ai").write_stream(response)
|
80 |
st.session_state.ac_translate_history.append({'role': 'assistant', 'content': translate_result})
|
|
|
|
26 |
if 'ac_translate_history' not in st.session_state:
|
27 |
st.session_state.ac_translate_history = []
|
28 |
|
29 |
+
if 'ac_markdown_text' not in st.session_state:
|
30 |
+
st.session_state.ac_markdown_text = ''
|
31 |
+
|
32 |
+
chat_container = st.container(height=580, border=False)
|
33 |
+
st.code(st.session_state.ac_markdown_text, language='markdown')
|
34 |
|
35 |
with chat_container:
|
36 |
for message in st.session_state.ac_translate_history:
|
|
|
82 |
response = ac_translate(prompt, st.session_state.get('is_en2zh'))
|
83 |
translate_result = chat_container.chat_message("ai").write_stream(response)
|
84 |
st.session_state.ac_translate_history.append({'role': 'assistant', 'content': translate_result})
|
85 |
+
st.session_state.ac_markdown_text = translate_result
|