Update README.md
Browse files
README.md
CHANGED
|
@@ -43,22 +43,27 @@ You are a helpful AI assistant developed by Kakao. Respond in the following form
|
|
| 43 |
|
| 44 |
messages = [
|
| 45 |
{"role" : "system", "content" : SYSTEM_PROMPT},
|
| 46 |
-
{"role" : "user", "content" : f"์ด
|
|
|
|
| 47 |
]
|
| 48 |
|
| 49 |
input_ids = tokenizer.apply_chat_template(
|
| 50 |
messages,
|
| 51 |
tokenize=True,
|
| 52 |
-
|
| 53 |
return_tensors="pt"
|
| 54 |
).to("cuda")
|
| 55 |
|
| 56 |
_ = model.eval()
|
|
|
|
|
|
|
| 57 |
with torch.no_grad():
|
| 58 |
output = model.generate(
|
| 59 |
input_ids,
|
| 60 |
max_new_tokens=1024,
|
| 61 |
-
streamer=streamer
|
|
|
|
|
|
|
| 62 |
)
|
| 63 |
|
| 64 |
print(tokenizer.decode(output[0]))
|
|
|
|
| 43 |
|
| 44 |
messages = [
|
| 45 |
{"role" : "system", "content" : SYSTEM_PROMPT},
|
| 46 |
+
{"role" : "user", "content" : f"์ฒ ์๊ฐ ํ ๋ณ์ ๊ธธ์ด๊ฐ 5km์ธ ์ ์ฌ๊ฐํ ๋ชจ์์ ๊ณต์์์ ๋๋ ๋ฅผ ๋ฐ๋ผ ๋๋ฌด๋ฅผ ์ฌ์ผ๋ ค๊ณ ํด. ๋๋ฌด ์ฌ์ด ๊ฐ๊ฒฉ์ 500m์ผ. ํ ๋๋ฌด๋ฅผ ์ฌ์ ๋ 17๋ฒ์ ์ฝ์ง์ด ํ์ํ๋ฐ, ๊ทผ๋ก๊ธฐ์ค๋ฒ์ ํ ์ฌ๋์ ์ธ์์์ 31๋ฒ์ ์ฝ์ง๋ฐ์ ๋ชปํด. ๊ทธ๋ ๋ค๋ฉด ์ฒ ์๊ฐ ๋๋ฌด์ฌ๊ธฐ๋ฅผ ์๋ฃํ๊ธฐ ์ํด์๋ ๋ช๋ช
์ ์ธ๋ถ๋ฅผ ์ถ๊ฐ๋ก ๊ณ ์ฉํด์ผ ํ ๊น?"},
|
| 47 |
+
{"role" : "system", "content" : "<reason> ์ฌํธํก ํ๊ณ , ์ฐจ๊ทผ์ฐจ๊ทผ ์๊ฐํด๋ณด์. ์ผ๋จ, "},
|
| 48 |
]
|
| 49 |
|
| 50 |
input_ids = tokenizer.apply_chat_template(
|
| 51 |
messages,
|
| 52 |
tokenize=True,
|
| 53 |
+
continue_final_message=True,
|
| 54 |
return_tensors="pt"
|
| 55 |
).to("cuda")
|
| 56 |
|
| 57 |
_ = model.eval()
|
| 58 |
+
|
| 59 |
+
# with model.disable_adapter():
|
| 60 |
with torch.no_grad():
|
| 61 |
output = model.generate(
|
| 62 |
input_ids,
|
| 63 |
max_new_tokens=1024,
|
| 64 |
+
streamer=streamer,
|
| 65 |
+
tokenizer=tokenizer,
|
| 66 |
+
stop_strings="</answer>"
|
| 67 |
)
|
| 68 |
|
| 69 |
print(tokenizer.decode(output[0]))
|