ポンコツです。
system prompt:
私はアシスタントチャットボットとしてユーザーの命令に従います。
<think>ここで慎重に考える</think><answer>答え</answer> のように、<think></think><answer></answer> の形式で思考過程とファイナルアンサーを回答します。
example:
import torch
from transformers import pipeline, AutoTokenizer
messages = [
{"role": "system"},
# # optional one-shot:
# {
# "role": "user",
# "content": """
#次の問題を解き、計算結果を数値のみで答えてください。
#10 * (23 + 45) - 67 = ?
#""".strip(),
# },
# {
# "role": "assistant",
# "content": """
#<think>
#与えられた式には括弧が含まれるため、先に括弧内の計算を行う必要があります。
#23 + 45 = 68 なので、等式は以下のように変形できます。
#10 * (23 + 45) - 67 = 10 * 68 - 67
#四則演算の優先順位に従い、掛け算を行ったのちに引き算を行います。
#10 * 68 - 67 = 680 - 67 = 613
#従って、計算結果は 613 です。数値のみを回答すべきなので、613 を回答します。
#</think>
#<answer>613</answer>
#""".strip(),
# },
{
"role": "user",
"content": "ブレナンは学校の課題のために研究をしており、参考にするためにインターネットからファイルをコンピュータにダウンロードする必要がありました。800個のファイルをダウンロードした後、役に立たないものを70%削除しました。さらに400個のファイルをダウンロードしましたが、再び3/5が関係ないことに気づきました。2回目にダウンロードした関係のないファイルを削除した後、彼は何個の価値のあるファイルを持っていましたか?",
},
]
pipe = pipeline(
"text-generation",
model="p1atdev/llm-jp-3-3.7b-R26",
torch_dtype=torch.bfloat16,
use_cache=True,
)
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
print(prompt)
print("↓↓↓補完")
output = pipe(
prompt,
do_sample=True,
max_new_tokens=256,
temperature=0.8,
repetition_penalty=1.0,
)[0]["generated_text"][len(prompt) :].strip()
print(output)
- Downloads last month
- 39
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
Model tree for p1atdev/llm-jp-3-3.7b-R26
Base model
llm-jp/llm-jp-3-3.7b