deleted the device placement
Browse files- handler.py +0 -5
handler.py
CHANGED
@@ -7,11 +7,6 @@ class EndpointHandler:
|
|
7 |
# Load model and tokenizer
|
8 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
9 |
self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", torch_dtype=torch.float16)
|
10 |
-
self.pipeline = TextGenerationPipeline(
|
11 |
-
model=self.model,
|
12 |
-
tokenizer=self.tokenizer,
|
13 |
-
device=0 if torch.cuda.is_available() else -1
|
14 |
-
)
|
15 |
|
16 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, str]]:
|
17 |
prompt_input = data.get("inputs", "")
|
|
|
7 |
# Load model and tokenizer
|
8 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
9 |
self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", torch_dtype=torch.float16)
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, str]]:
|
12 |
prompt_input = data.get("inputs", "")
|