ChatTemplatedInference
Wraps an InferenceClient to apply a chat template before each generate call.
Attributes
attributenamestr= 'chat_templated'attributesystem_prompt= system_promptattributeuser_template= user_templateattributeenable_thinking= enable_thinkingFunctions
func__init__(self, base, *, system_prompt, user_template='{prompt}', enable_thinking=None) -> NoneparamselfparambaseAnyparamsystem_promptstrparamuser_templatestr= '{prompt}'paramenable_thinkingbool | None= NoneReturns
Nonefuncgenerate(self, *, prompt, max_tokens=256, temperature=0.0, stop=None) -> strparamselfparampromptstrparammax_tokensint= 256paramtemperaturefloat= 0.0paramstoplist[str] | None= NoneReturns
str