Spaces:
Sleeping
Sleeping
[update]add main
Browse files
main.py
CHANGED
@@ -42,11 +42,12 @@ def init_model(pretrained_model_name_or_path: str):
|
|
42 |
offload_state_dict=True,
|
43 |
# load_in_4bit=True,
|
44 |
)
|
45 |
-
if model.config.model_type == "chatglm":
|
46 |
-
|
47 |
-
else:
|
48 |
-
|
49 |
-
|
|
|
50 |
|
51 |
tokenizer = AutoTokenizer.from_pretrained(
|
52 |
pretrained_model_name_or_path,
|
|
|
42 |
offload_state_dict=True,
|
43 |
# load_in_4bit=True,
|
44 |
)
|
45 |
+
# if model.config.model_type == "chatglm":
|
46 |
+
# model = model.eval()
|
47 |
+
# else:
|
48 |
+
# model = model.to(device)
|
49 |
+
# model = model.bfloat16().eval()
|
50 |
+
model = model.bfloat16().eval()
|
51 |
|
52 |
tokenizer = AutoTokenizer.from_pretrained(
|
53 |
pretrained_model_name_or_path,
|