Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,13 +30,13 @@ routes.get_types = get_types
|
|
30 |
|
31 |
# App code
|
32 |
|
33 |
-
model_name = "
|
34 |
|
35 |
#petals-team/StableBeluga2
|
36 |
#daekeun-ml/Llama-2-ko-DPO-13B
|
37 |
#daekeun-ml/Llama-2-ko-instruct-13B
|
38 |
#quantumaikr/llama-2-70b-fb16-korean
|
39 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
40 |
|
41 |
model = None
|
42 |
|
@@ -151,7 +151,7 @@ def check(model_name):
|
|
151 |
def init():
|
152 |
global model
|
153 |
if check(model_name):
|
154 |
-
model = AutoDistributedModelForCausalLM.from_pretrained(model_name)
|
155 |
|
156 |
|
157 |
def chat(id, npc, text):
|
|
|
30 |
|
31 |
# App code
|
32 |
|
33 |
+
model_name = "petals-team/StableBeluga2"
|
34 |
|
35 |
#petals-team/StableBeluga2
|
36 |
#daekeun-ml/Llama-2-ko-DPO-13B
|
37 |
#daekeun-ml/Llama-2-ko-instruct-13B
|
38 |
#quantumaikr/llama-2-70b-fb16-korean
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
40 |
|
41 |
model = None
|
42 |
|
|
|
151 |
def init():
|
152 |
global model
|
153 |
if check(model_name):
|
154 |
+
model = AutoDistributedModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
|
155 |
|
156 |
|
157 |
def chat(id, npc, text):
|