Fix is_bfloat16_supported missing (#510)
* Update llama.py * offload * Update llama.py * Update llama.py * Update llama.py * Update llama.py * Update llama.py * Update llama.py * Update llama.py * continued pretraining trainer * Update trainer.py * Update trainer.py * Update trainer.py * Update trainer.py * is_bfloat16_supported * Update __init__.py * Update README.md * Update llama.py * is_bfloat16_supported * Update __init__.py
This commit is contained in:
parent
5134a42f06
commit
b107b432bb
2 changed files with 8 additions and 0 deletions
|
|
@ -41,6 +41,13 @@ try:
|
|||
except:
|
||||
raise ImportError("Pytorch is not installed. Go to https://pytorch.org/.\n"\
|
||||
"We have some installation instructions on our Github page.")
|
||||
pass
|
||||
|
||||
# Fix up is_bf16_supported https://github.com/unslothai/unsloth/issues/504
|
||||
major_version, minor_version = torch.cuda.get_device_capability()
|
||||
SUPPORTS_BFLOAT16 = (major_version >= 8)
|
||||
def is_bf16_supported(): return SUPPORTS_BFLOAT16
|
||||
torch.cuda.is_bf16_supported = is_bf16_supported
|
||||
|
||||
# We support Pytorch 2
|
||||
# Fixes https://github.com/unslothai/unsloth/issues/38
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ from dataclasses import dataclass, field
|
|||
from typing import Optional
|
||||
from transformers import TrainingArguments
|
||||
from trl import SFTTrainer
|
||||
from . import is_bfloat16_supported
|
||||
|
||||
__all__ = [
|
||||
"UnslothTrainingArguments",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue