Commit
·
c5940bf
1
Parent(s):
02ad40f
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -10,7 +10,7 @@ class EndpointHandler:
|
|
10 |
def __init__(self, path=""):
|
11 |
# load the model
|
12 |
tokenizer = AutoTokenizer.from_pretrained(path)
|
13 |
-
model = AutoModelForCausalLM.from_pretrained(path, device_map="auto",torch_dtype=dtype)
|
14 |
# create inference pipeline
|
15 |
self.pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
16 |
|
|
|
10 |
def __init__(self, path=""):
|
11 |
# load the model
|
12 |
tokenizer = AutoTokenizer.from_pretrained(path)
|
13 |
+
model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", trust_remote_code=True, torch_dtype=dtype)
|
14 |
# create inference pipeline
|
15 |
self.pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
16 |
|