Update handler.py
Browse files- handler.py +1 -6
handler.py
CHANGED
@@ -13,15 +13,10 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
13 |
class EndpointHandler():
|
14 |
def __init__(self, path=""):
|
15 |
config = PeftConfig.from_pretrained(path)
|
16 |
-
|
17 |
-
bnb_config = BitsAndBytesConfig(
|
18 |
-
bnb_4bit_quant_type="nf4",
|
19 |
-
bnb_4bit_compute_dtype=torch.float16,
|
20 |
-
)
|
21 |
|
22 |
model = AutoModelForCausalLM.from_pretrained(
|
23 |
model_name,
|
24 |
-
|
25 |
trust_remote_code=True,
|
26 |
device_map="auto"
|
27 |
)
|
|
|
13 |
class EndpointHandler():
|
14 |
def __init__(self, path=""):
|
15 |
config = PeftConfig.from_pretrained(path)
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
model = AutoModelForCausalLM.from_pretrained(
|
18 |
model_name,
|
19 |
+
load_in_4bit=True,
|
20 |
trust_remote_code=True,
|
21 |
device_map="auto"
|
22 |
)
|