shao-shuai commited on
Commit ·
267a387
1
Parent(s): e306d43
no appending message
Browse files
app.py
CHANGED
|
@@ -14,16 +14,16 @@ client = OpenAI(
|
|
| 14 |
)
|
| 15 |
|
| 16 |
# set the context
|
| 17 |
-
messages = [{"role": "system", "content": "Translate the patent text from Chinese to English."}]
|
| 18 |
|
| 19 |
# set model
|
| 20 |
model = "gpt-3.5-turbo-16k"
|
| 21 |
|
| 22 |
# Define the reset function
|
| 23 |
-
def reset_context():
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
# get the user inputs
|
| 29 |
def translate(text_cn):
|
|
|
|
| 14 |
)
|
| 15 |
|
| 16 |
# set the context
|
| 17 |
+
messages = [{"role": "system", "content": "Translate the patent text from Chinese to English."}, {"role": "user", "content": None}]
|
| 18 |
|
| 19 |
# set model
|
| 20 |
model = "gpt-3.5-turbo-16k"
|
| 21 |
|
| 22 |
# Define the reset function
|
| 23 |
+
# def reset_context():
|
| 24 |
+
# global messages
|
| 25 |
+
# messages = [{"role": "system", "content": "Translate the patent text from Chinese to English."}, {"role": "user", "content": None}]
|
| 26 |
+
# return "Context reset!"
|
| 27 |
|
| 28 |
# get the user inputs
|
| 29 |
def translate(text_cn):
|