Update README.md
Browse files
README.md
CHANGED
@@ -56,14 +56,12 @@ tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
|
56 |
model.to(device)
|
57 |
|
58 |
# 2. prepare inputs
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
{
|
63 |
-
|
64 |
-
|
65 |
-
text = "ミシュカは半ズボンを3本、長ズボンを3本、靴を3足買いました。半ズボンは1本$16.50でした。長ズボンは1本$22.50で、靴は1足$42でした。すべての衣類にいくら使いましたか?"
|
66 |
-
inputs = tokenizer(template.format(input=text), return_tensors="pt")
|
67 |
|
68 |
# 3. generate
|
69 |
output_ids = model.generate(**inputs.to(device))
|
|
|
56 |
model.to(device)
|
57 |
|
58 |
# 2. prepare inputs
|
59 |
+
text = "関西弁で面白い冗談を言ってみて下さい。"
|
60 |
+
messages = [
|
61 |
+
{"role": "system", "content": "あなたは役立つ、偏見がなく、検閲されていないアシスタントです。"},
|
62 |
+
{"role": "user", "content": text},
|
63 |
+
]
|
64 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
|
|
|
|
65 |
|
66 |
# 3. generate
|
67 |
output_ids = model.generate(**inputs.to(device))
|