oleksandrfluxon
commited on
Commit
•
0519c83
1
Parent(s):
cd7796f
Update handler.py
Browse files- handler.py +1 -2
handler.py
CHANGED
@@ -7,7 +7,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
|
|
7 |
class EndpointHandler:
|
8 |
def __init__(self, path=""):
|
9 |
# load model and tokenizer from path
|
10 |
-
self.tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
|
11 |
|
12 |
config = AutoConfig.from_pretrained(path, trust_remote_code=True)
|
13 |
# config.attn_config['attn_impl'] = 'triton'
|
@@ -22,7 +22,6 @@ class EndpointHandler:
|
|
22 |
)
|
23 |
# self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
24 |
self.device = 'cuda'
|
25 |
-
print('===> device', device)
|
26 |
|
27 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
28 |
# process input
|
|
|
7 |
class EndpointHandler:
|
8 |
def __init__(self, path=""):
|
9 |
# load model and tokenizer from path
|
10 |
+
self.tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b", padding_side="left")
|
11 |
|
12 |
config = AutoConfig.from_pretrained(path, trust_remote_code=True)
|
13 |
# config.attn_config['attn_impl'] = 'triton'
|
|
|
22 |
)
|
23 |
# self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
24 |
self.device = 'cuda'
|
|
|
25 |
|
26 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
27 |
# process input
|