Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -1049,10 +1049,10 @@ def continue_writing(history, system_message, max_tokens, temperature, top_p):
|
|
1049 |
5. νμν κ²½μ° μΆκ°μ μΈ μ΄λ―Έμ§ ν둬ννΈ μμ±
|
1050 |
"""
|
1051 |
|
|
|
1052 |
messages = [
|
1053 |
{"role": "system", "content": system_message},
|
1054 |
-
{"role": "
|
1055 |
-
{"role": "user", "content": continue_prompt}
|
1056 |
]
|
1057 |
|
1058 |
try:
|
@@ -1069,13 +1069,16 @@ def continue_writing(history, system_message, max_tokens, temperature, top_p):
|
|
1069 |
token = message.choices[0].delta.content
|
1070 |
if token:
|
1071 |
full_response += token
|
1072 |
-
|
1073 |
-
|
|
|
|
|
1074 |
|
1075 |
except Exception as e:
|
1076 |
error_message = f"κ³μ μμ± μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}"
|
1077 |
-
history.
|
1078 |
-
|
|
|
1079 |
|
1080 |
return history
|
1081 |
|
|
|
1049 |
5. νμν κ²½μ° μΆκ°μ μΈ μ΄λ―Έμ§ ν둬ννΈ μμ±
|
1050 |
"""
|
1051 |
|
1052 |
+
# λ©μμ§ κ΅¬μ‘° μμ
|
1053 |
messages = [
|
1054 |
{"role": "system", "content": system_message},
|
1055 |
+
{"role": "user", "content": continue_prompt} # μ¬μ©μ λ©μμ§λ‘ μμ
|
|
|
1056 |
]
|
1057 |
|
1058 |
try:
|
|
|
1069 |
token = message.choices[0].delta.content
|
1070 |
if token:
|
1071 |
full_response += token
|
1072 |
+
# μ΄μ λν κΈ°λ‘μ μ μ§νλ©΄μ μλ‘μ΄ μλ΅ μΆκ°
|
1073 |
+
new_history = history.copy()
|
1074 |
+
new_history.append(("κ³μ μμ±", full_response))
|
1075 |
+
yield new_history
|
1076 |
|
1077 |
except Exception as e:
|
1078 |
error_message = f"κ³μ μμ± μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}"
|
1079 |
+
new_history = history.copy()
|
1080 |
+
new_history.append(("μ€λ₯", error_message))
|
1081 |
+
yield new_history
|
1082 |
|
1083 |
return history
|
1084 |
|