Spaces:
Sleeping
Sleeping
Update handler.py
Browse files- 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
|
| 27 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
| 28 |
-
self.model =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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):
|