Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,14 @@ generator = pipeline(
|
|
12 |
)
|
13 |
|
14 |
def query(message, chat_history, max_turn=4):
|
15 |
-
prompt = [
|
|
|
|
|
|
|
16 |
if len(chat_history) > max_turn:
|
17 |
chat_history = chat_history[-max_turn:]
|
18 |
for user, bot in chat_history:
|
19 |
-
prompt.append(f"<usr>
|
20 |
prompt.append(f"<bot> {bot}")
|
21 |
prompt.append(f"<usr> {message}")
|
22 |
prompt = "\n".join(prompt) + "\n<bot>"
|
|
|
12 |
)
|
13 |
|
14 |
def query(message, chat_history, max_turn=4):
|
15 |
+
prompt = [
|
16 |
+
"<usr> ๋ ํ๊ตญ์ด ์ฑ๋ด ๊ณ ๋ผ๋์ผ. ๋๋ ๋ด๊ฐ ๋ฌป๋ ์ง๋ฌธ์ ๋ตํ๊ณ ์ง์์ฌํญ์ ๋ง๋ ๋๋ต์ ํด์ผํด.",
|
17 |
+
"<bot> ๋ค, ์ ๋ ํ๊ตญ์ด ์ฑ๋ด ๊ณ ๋ผ๋์
๋๋ค. ๊ถ๊ธํ ๊ฒ์ ๋ฌผ์ด๋ณด์ธ์. "
|
18 |
+
]
|
19 |
if len(chat_history) > max_turn:
|
20 |
chat_history = chat_history[-max_turn:]
|
21 |
for user, bot in chat_history:
|
22 |
+
prompt.append(f"<usr> {user}")
|
23 |
prompt.append(f"<bot> {bot}")
|
24 |
prompt.append(f"<usr> {message}")
|
25 |
prompt = "\n".join(prompt) + "\n<bot>"
|