Spaces:
Runtime error
Runtime error
Download quantization_utils.py from bala1802/Phi2_FineTuned: direct link, hf CLI and curl.
- Browser
- Download file 316 Bytes
-
https://huggingface.co/spaces/bala1802/Phi2_FineTuned/resolve/main/quantization_utils.py
- Command line
-
hf download hf://spaces/bala1802/Phi2_FineTuned/quantization_utils.py
-
curl -L -o quantization_utils.py https://huggingface.co/spaces/bala1802/Phi2_FineTuned/resolve/main/quantization_utils.py
316 Bytes
| import torch | |
| from transformers import BitsAndBytesConfig | |
| import config | |
| def load_bits_and_bytes_config(): | |
| bnb_config = BitsAndBytesConfig( | |
| load_in_4bit=config.ENABLE_4BIT, | |
| bnb_4bit_quant_type=config.QUANTIZATION_TYPE, | |
| bnb_4bit_compute_dtype=torch.float16 | |
| ) | |
| return bnb_config |