jscore2023 commited on
Commit
ab8d3b7
1 Parent(s): 92b4e4d

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -14,10 +14,10 @@ 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, 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)
21
 
22
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
23
  """
 
14
  class EndpointHandler():
15
  def __init__(self, path=""):
16
  config = PeftConfig.from_pretrained(path)
17
+ model = AutoModelForCausalLM.from_pretrained("vilsonrodrigues/falcon-7b-instruct-sharded", device_map={"":0}, trust_remote_code=True, torch_dtype=torch.float16)
18
+ self.tokenizer = AutoTokenizer.from_pretrained("vilsonrodrigues/falcon-7b-instruct-sharded")
19
  # Load the Lora model
20
+ self.model = PeftModel.from_pretrained(model, "jscore2023/falcon-7b-3")
21
 
22
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
23
  """