jscore2023 commited on
Commit
c64a50d
1 Parent(s): 1860c9a

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -14,7 +14,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
14
  class EndpointHandler():
15
  def __init__(self, path=""):
16
  config = PeftConfig.from_pretrained(path)
17
- model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, load_in_8bit=True, device_map='auto')
18
  self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
19
  # Load the Lora model
20
  self.model = PeftModel.from_pretrained(model, path)
 
14
  class EndpointHandler():
15
  def __init__(self, path=""):
16
  config = PeftConfig.from_pretrained(path)
17
+ model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, device_map={"":0}, trust_remote_code=True, torch_dtype=torch.float16)
18
  self.tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
19
  # Load the Lora model
20
  self.model = PeftModel.from_pretrained(model, path)