Skip to content

Commit

Permalink
Fix: bf16 torch dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
taziksh committed Dec 19, 2023
1 parent d25c34c commit 959845e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/axolotl/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def do_inference(
)

model = model.to(cfg.device)
if cfg.bf16:
model = model.to(torch.bfloat16)

while True:
print("=" * 80)
Expand Down Expand Up @@ -185,6 +187,8 @@ def do_inference_gradio(
)

model = model.to(cfg.device)
if cfg.bf16:
model = model.to(torch.bfloat16)

def generate(instruction):
if not instruction:
Expand Down

0 comments on commit 959845e

Please sign in to comment.