MCPcopy
hub / github.com/bigcode-project/starcoder / from_dict

Method from_dict

chat/dialogues.py:97–105  ·  view source on GitHub ↗
(cls, data)

Source from the content-addressed store, hash-verified

95
96 @classmethod
97 def from_dict(cls, data):
98 return DialogueTemplate(
99 system=data["system"] if "system" in data else "",
100 messages=data["messages"] if "messages" in data else None,
101 system_token=data["system_token"] if "system_token" in data else "<|system|>",
102 user_token=data["user_token"] if "user_token" in data else "<|user|>",
103 assistant_token=data["assistant_token"] if "assistant_token" in data else "<|assistant|>",
104 end_token=data["end_token"] if "end_token" in data else "<|end|>",
105 )
106
107 def _save_pretrained(self, save_directory: Union[str, Path]) -> None:
108 save_directory = Path(save_directory)

Callers 1

_from_pretrainedMethod · 0.80

Calls 1

DialogueTemplateClass · 0.85

Tested by

no test coverage detected