MCPcopy Create free account
hub / github.com/ZinYY/TreeLoRA / __init__

Method __init__

inference/ICL.py:114–118  ·  view source on GitHub ↗
(self, model_path)

Source from the content-addressed store, hash-verified

112
113class API:
114 def __init__(self, model_path):
115 self.path = model_path
116 self.tokenizer=AutoTokenizer.from_pretrained(self.path)
117 self.tokenizer.pad_token=self.tokenizer.eos_token
118 self.model=LlamaForCausalLM.from_pretrained(self.path,device_map="auto")
119
120 def api(self,prompt):
121 inputs = self.tokenizer(prompt, return_tensors="pt", padding=True).to("cuda")

Callers

nothing calls this directly

Calls 1

from_pretrainedMethod · 0.45

Tested by

no test coverage detected