Aye10032
commited on
Commit
·
0a2577e
1
Parent(s):
9479c01
fix
Browse files- pages/AcademicTranslate.py +3 -0
- pages/Translate.py +1 -2
pages/AcademicTranslate.py
CHANGED
@@ -23,6 +23,9 @@ with st.sidebar:
|
|
23 |
else:
|
24 |
st.caption('zh → en')
|
25 |
|
|
|
|
|
|
|
26 |
with st.container(height=610, border=False) as chat_container:
|
27 |
for message in st.session_state.ac_translate_history:
|
28 |
icon = 'logo.png' if message['role'] != 'user' else None
|
|
|
23 |
else:
|
24 |
st.caption('zh → en')
|
25 |
|
26 |
+
if 'ac_translate_history' not in st.session_state:
|
27 |
+
st.session_state.ac_translate_history = []
|
28 |
+
|
29 |
with st.container(height=610, border=False) as chat_container:
|
30 |
for message in st.session_state.ac_translate_history:
|
31 |
icon = 'logo.png' if message['role'] != 'user' else None
|
pages/Translate.py
CHANGED
@@ -29,7 +29,7 @@ with st.sidebar:
|
|
29 |
st.caption('markdown')
|
30 |
else:
|
31 |
st.caption('latex')
|
32 |
-
|
33 |
st.toggle('双语输出', key='trans_en_output')
|
34 |
|
35 |
|
@@ -58,7 +58,6 @@ def get_translate_and_conclude(question: str, step: int):
|
|
58 |
else:
|
59 |
raise Exception("Wrong step value")
|
60 |
|
61 |
-
|
62 |
llm = ChatOpenAI(
|
63 |
model_name="gpt-4o-mini",
|
64 |
temperature=0,
|
|
|
29 |
st.caption('markdown')
|
30 |
else:
|
31 |
st.caption('latex')
|
32 |
+
|
33 |
st.toggle('双语输出', key='trans_en_output')
|
34 |
|
35 |
|
|
|
58 |
else:
|
59 |
raise Exception("Wrong step value")
|
60 |
|
|
|
61 |
llm = ChatOpenAI(
|
62 |
model_name="gpt-4o-mini",
|
63 |
temperature=0,
|