dordonezc commited on
Commit
cc645d3
1 Parent(s): 3873022

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -4,7 +4,7 @@ from typing import Dict, List, Any
4
 
5
  class EndpointHandler():
6
  def __init__(self, path=""):
7
- self.quant = quantization_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16)
8
  self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", quantization_config=self.quant, trust_remote_code=True)
9
  self.tokenizer = AutoTokenizer.from_pretrained(path)
10
  self.pipeline = pipeline("text-generation", model=self.model, tokenizer=self.tokenizer)
 
4
 
5
  class EndpointHandler():
6
  def __init__(self, path=""):
7
+ self.quant = quantization_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True)
8
  self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", quantization_config=self.quant, trust_remote_code=True)
9
  self.tokenizer = AutoTokenizer.from_pretrained(path)
10
  self.pipeline = pipeline("text-generation", model=self.model, tokenizer=self.tokenizer)