BlueDice commited on
Commit
35f5029
·
1 Parent(s): 8eefc6d

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +7 -3
handler.py CHANGED
@@ -1,4 +1,3 @@
1
- from optimum.onnxruntime import ORTModelForCausalLM
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
3
  import re
4
  import time
@@ -23,9 +22,14 @@ Alice Gate: *Alice strides into the room with a smile, her eyes lighting up when
23
 
24
  class SweetCommander():
25
 
26
- def __init__(self, path="BlueDice/Katakuri-350m-onnx") -> None:
27
  self.tokenizer = AutoTokenizer.from_pretrained(path)
28
- self.model = ORTModelForCausalLM.from_pretrained(path)#provider = "CUDAExecutionProvider"
 
 
 
 
 
29
  self.star_line = "***********************************************************"
30
 
31
  def __call__(self, user_name, user_input):
 
 
1
  from transformers import AutoTokenizer, AutoModelForCausalLM
2
  import re
3
  import time
 
22
 
23
  class SweetCommander():
24
 
25
+ def __init__(self, path="BlueDice/Katakuri-350m") -> None:
26
  self.tokenizer = AutoTokenizer.from_pretrained(path)
27
+ self.model = AutoModelForCausalLM.from_pretrained(
28
+ path,
29
+ low_cpu_mem_usage = True,
30
+ trust_remote_code = False,
31
+ torch_dtype = torch.float32,
32
+ )
33
  self.star_line = "***********************************************************"
34
 
35
  def __call__(self, user_name, user_input):