pvduy commited on
Commit
23521bb
1 Parent(s): d34759f

load model bf16

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -62,9 +62,8 @@ def predict(message, history, system_prompt, temperature, max_tokens):
62
  if __name__ == "__main__":
63
  args = parse_args()
64
  tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable-code-instruct-3b")
65
- model = AutoModelForCausalLM.from_pretrained("stabilityai/stable-code-instruct-3b")
66
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
67
- model = model.half()
68
  model = model.to(device)
69
  gr.ChatInterface(
70
  predict,
 
62
  if __name__ == "__main__":
63
  args = parse_args()
64
  tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable-code-instruct-3b")
65
+ model = AutoModelForCausalLM.from_pretrained("stabilityai/stable-code-instruct-3b", torch_dtype=torch.bfloat16)
66
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
67
  model = model.to(device)
68
  gr.ChatInterface(
69
  predict,