qgyd2021 commited on
Commit
fd2dbb8
1 Parent(s): 58ab7a5

[update]add main

Browse files
Files changed (1) hide show
  1. main.py +6 -5
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
- model = model.eval()
47
- else:
48
- model = model.to(device)
49
- model = model.bfloat16().eval()
 
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,