Update handler.py
Browse files- handler.py +3 -1
handler.py
CHANGED
@@ -4,9 +4,11 @@ import json
|
|
4 |
|
5 |
class EndpointHandler():
|
6 |
def __init__(self, path="ceiteach/chart-no-pretrain-llama31-unsloth"):
|
|
|
7 |
model_name = "ceiteach/chart-no-pretrain-llama31-unsloth"
|
|
|
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
9 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype = torch.float16, device_map="auto")
|
10 |
self.model = model
|
11 |
self.tokenizer = tokenizer
|
12 |
|
|
|
4 |
|
5 |
class EndpointHandler():
|
6 |
def __init__(self, path="ceiteach/chart-no-pretrain-llama31-unsloth"):
|
7 |
+
base_model_name = "unsloth/Meta-Llama-3.1-8B-bnb-4bit"
|
8 |
model_name = "ceiteach/chart-no-pretrain-llama31-unsloth"
|
9 |
+
model = AutoModelForCausalLM.from_pretrained(base_model_name)
|
10 |
+
model.load_adapter(model_name)
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
12 |
self.model = model
|
13 |
self.tokenizer = tokenizer
|
14 |
|