MCPcopy Create free account
hub / github.com/modelscope/modelscope / register_template

Function register_template

modelscope/preprocessors/templates/template.py:141–146  ·  view source on GitHub ↗
(template_type: str, template: Template, *, exist_ok: bool = False, **kwargs)

Source from the content-addressed store, hash-verified

139
140
141def register_template(template_type: str, template: Template, *, exist_ok: bool = False, **kwargs) -> None:
142 if not exist_ok and template_type in TEMPLATE_MAPPING:
143 raise ValueError(f'The `{template_type}` has already been registered in the TEMPLATE_MAPPING.')
144 template.template_type = template_type
145 template_info = {'template': template, **kwargs}
146 TEMPLATE_MAPPING[template_type] = template_info
147
148
149register_template(

Callers 1

template.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…