[ChatStream] matsuo-lab/weblab-10b-instruction-sft用の ChatPrompt

[ChatStream] matsuo-lab/weblab-10b-instruction-sft用の ChatPrompt

matsuo-lab/weblab-10b-instruction-sft 用の ChatPrompt クラスをリリースしました。
最新バージョンのChatStreamに取り込んでいますが、以下コードを使用することも可能です。

from chatstream import AbstractChatPrompt
from chatstream.chat_prompt.prompt_ttl import PromptTTL


class ChatPromptMatsuoLabJpGptNeoxInstSft(AbstractChatPrompt):

    def __init__(self):
        super().__init__()  # Call the initialization of the base class
        self.set_system("以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。")
        self.set_requester("指示")
        self.set_responder("応答")
        self.set_prefix_as_stop_str_enabled(True)  # enable requester's prompt suffix as stop str
        self.set_prompt_ttl(PromptTTL.SINGLE_TURN)

    def get_stop_strs(self):
        if not self.chat_mode:
            return None
        return ["Q:"]

    def get_replacement_when_input(self):
        return None

    def get_replacement_when_output(self):
        return None

    def create_prompt(self, opts={}):
        if self.chat_mode == False:
            return self.get_requester_last_msg()

        # Chat Mode == True の場合のプロンプトを構築する
        ret = self.system + "\n\n";

        for chat_content in self.get_contents(opts):

            chat_content_role = chat_content.get_role()
            chat_content_message = chat_content.get_message()
            chat_content_child_messages = chat_content.get_child_messages()
            has_child_messages = chat_content.has_child_messages()

            if chat_content_role:

                if chat_content_message:
                    merged_message = f"### {chat_content_role}: \n" + chat_content_message + "\n\n"
                    if has_child_messages:
                        merged_message += f"### 入力: \n"
                        chat_content_child_messages = chat_content.get_child_messages()
                        for message in chat_content_child_messages:
                            merged_message += message + "\n\n"
                else:
                    merged_message = f"### {chat_content_role}: "

                ret += merged_message

        return ret

    def build_initial_prompt(self, chat_prompt):
        # 初期プロンプトは実装しない
        pass


Read more

ゼロから作るコーディングエージェント【第2回】完了は「作った」ではなく「動いた」で決める。完了の門と、押し戻しに書くこと

ゼロから作るコーディングエージェント【第2回】完了は「作った」ではなく「動いた」で決める。完了の門と、押し戻しに書くこと

モデルの「完了しました」は5つの形ですり抜けました。構文検査だけ、テストは通るが動かない、待ち受けは立つが最初の要求で落ちる、起動するが仕様のAPIが無い、assertの無いテスト。完了の門を3段で閉じる設計と、押し戻しに「落ちた行と調べ方」を書いて「答え」を書かない理由を、数字つきで書きます。

By Qualiteg プロダクト開発部
「Blackwell」は 1 つではなかった。NVIDIA の Compute Capability 番号のわかりにくさを整理する

「Blackwell」は 1 つではなかった。NVIDIA の Compute Capability 番号のわかりにくさを整理する

こんにちは! NVIDIA の GPU を扱っていると、sm_120 や sm_100 といった番号を見かけます。Compute Capability と呼ばれる番号です。 この番号、製品の世代名と対応しているように見えて、実はずれています。 きっかけは、2026年9月23日に公開された TensorRT-LLM の v1.3.0rc28 でした。リリースノートに「SM107」という記述があります。次世代の Rubin に対応した、という文脈です。 ここで引っかかります。Blackwell の GeForce は sm_120 です。次の世代の Rubin が、なぜ 107 という小さい番号なのでしょうか。 調べてみると、引っかかりの原因は Rubin ではありませんでした。

By Qualiteg プロダクト開発部