LocalInference
Attributes
attributenamestr= 'local'attributeConfigtype= LocalInferenceConfigattributetokenizer= AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)attributemodel= AutoModelForCausalLM.from_pretrained(model_name, dtype=torch_dtype, trust_remote_code=True, device_map=(device if device != 'auto' else 'auto'))Functions
func__init__(self, *, model_name, adapter_path=None, dtype='bfloat16', device='auto') -> Noneparamselfparammodel_namestrparamadapter_pathstr | None= Noneparamdtypestr= 'bfloat16'paramdevicestr= 'auto'Returns
Nonefuncgenerate(self, *, prompt, max_tokens=256, temperature=0.0, stop=None) -> strparamselfparampromptstrparammax_tokensint= 256paramtemperaturefloat= 0.0paramstoplist[str] | None= NoneReturns
str