MCPcopy
hub / github.com/lm-sys/FastChat / make_conv_template

Method make_conv_template

fastchat/serve/base_model_worker.py:63–78  ·  view source on GitHub ↗

can be overrided to costomize the conversation template for different model workers.

(
        self,
        conv_template: str = None,
        model_path: str = None,
    )

Source from the content-addressed store, hash-verified

61 worker = self
62
63 def make_conv_template(
64 self,
65 conv_template: str = None,
66 model_path: str = None,
67 ) -> Conversation:
68 """
69 can be overrided to costomize the conversation template for different model workers.
70 """
71 from fastchat.conversation import get_conv_template
72 from fastchat.model.model_adapter import get_conversation_template
73
74 if conv_template:
75 conv = get_conv_template(conv_template)
76 else:
77 conv = get_conversation_template(model_path)
78 return conv
79
80 def init_heart_beat(self):
81 self.register_to_controller()

Callers 1

__init__Method · 0.95

Calls 2

get_conv_templateFunction · 0.90

Tested by

no test coverage detected