Feature Extraction
Transformers
Safetensors
English
gemma
bnb-my-repo
unsloth
bnb
4-bit precision
bitsandbytes
Instructions to use lainlives/codegemma-7b-it-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lainlives/codegemma-7b-it-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="lainlives/codegemma-7b-it-bnb-4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("lainlives/codegemma-7b-it-bnb-4bit") model = AutoModel.from_pretrained("lainlives/codegemma-7b-it-bnb-4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .gitattributes+1
- README.mdAdded+57
- chat_template.jinjaAdded+4
- config.jsonAdded+48
- model.safetensorsAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+16
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657---base_model:- unsloth/codegemma-7b-itlanguage:- enlibrary_name: transformerslicense: apache-2.0tags:- bnb-my-repo- unsloth- transformers- gemma- bnb---# unsloth/codegemma-7b-it (Quantized)
## DescriptionThis model is a quantized version of the original model [`unsloth/codegemma-7b-it`](https://huggingface.co/unsloth/codegemma-7b-it).
## Quantization Details- **Quantization Type**: int4- **bnb_4bit_quant_type**: nf4- **bnb_4bit_use_double_quant**: True- **bnb_4bit_compute_dtype**: bfloat16- **bnb_4bit_quant_storage**: uint8
# 📄 Original Model Information
# Finetune Mistral, Gemma, Llama 2-5x faster with 70% less memory via Unsloth!
We have a Google Colab Tesla T4 notebook for CodeGemma 7b here: https://colab.research.google.com/drive/19lwcRk_ZQ_ZtX-qzFP3qZBBHZNcMD1hh?usp=sharing
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/Discord%20button.png" width="200"/>](https://discord.gg/u54VK8m8tk)[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/buy%20me%20a%20coffee%20button.png" width="200"/>](https://ko-fi.com/unsloth)[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
## ✨ Finetune for Free
All notebooks are **beginner friendly**! Add your dataset, click "Run All", and you'll get a 2x faster finetuned model which can be exported to GGUF, vLLM or uploaded to Hugging Face.
| Unsloth supports | Free Notebooks | Performance | Memory use ||-----------------|--------------------------------------------------------------------------------------------------------------------------|-------------|----------|| **Gemma 7b** | [▶️ Start on Colab](https://colab.research.google.com/drive/10NbwlsRChbma1v55m8LAPYG15uQv6HLo?usp=sharing) | 2.4x faster | 58% less || **Mistral 7b** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Dyauq4kTZoLewQ1cApceUQVNcnnNTzg_?usp=sharing) | 2.2x faster | 62% less || **Llama-2 7b** | [▶️ Start on Colab](https://colab.research.google.com/drive/1lBzz5KeZJKXjvivbYvmGarix9Ao6Wxe5?usp=sharing) | 2.2x faster | 43% less || **TinyLlama** | [▶️ Start on Colab](https://colab.research.google.com/drive/1AZghoNBQaMDgWJpi4RbffGM1h6raLUj9?usp=sharing) | 3.9x faster | 74% less || **CodeLlama 34b** A100 | [▶️ Start on Colab](https://colab.research.google.com/drive/1y7A0AxE3y8gdj4AVkl2aZX47Xu3P1wJT?usp=sharing) | 1.9x faster | 27% less || **Mistral 7b** 1xT4 | [▶️ Start on Kaggle](https://www.kaggle.com/code/danielhanchen/kaggle-mistral-7b-unsloth-notebook) | 5x faster\* | 62% less || **DPO - Zephyr** | [▶️ Start on Colab](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) | 1.9x faster | 19% less |
- This [conversational notebook](https://colab.research.google.com/drive/1Aau3lgPzeZKQ-98h69CCu1UJcvIBLmy2?usp=sharing) is useful for ShareGPT ChatML / Vicuna templates.- This [text completion notebook](https://colab.research.google.com/drive/1ef-tab5bhkvWmBOObepl1WgJvfvSzn5Q?usp=sharing) is for raw text. This [DPO notebook](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) replicates Zephyr.- \* Kaggle has 2x T4s, but we use 1. Due to overhead, 1x T4 is 5x faster.1234{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '' + message['content'] | trim + '<end_of_turn>' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model'}}{% endif %}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748{ "architectures": [ "GemmaModel" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": 2, "dtype": "bfloat16", "eos_token_id": 1, "head_dim": 256, "hidden_act": "gelu_pytorch_tanh", "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 3072, "initializer_range": 0.02, "intermediate_size": 24576, "max_position_embeddings": 8192, "model_type": "gemma", "num_attention_heads": 16, "num_hidden_layers": 28, "num_key_value_heads": 16, "pad_token_id": 0, "quantization_config": { "_load_in_4bit": true, "_load_in_8bit": false, "bnb_4bit_compute_dtype": "bfloat16", "bnb_4bit_quant_storage": "uint8", "bnb_4bit_quant_type": "nf4", "bnb_4bit_use_double_quant": true, "llm_int8_enable_fp32_cpu_offload": false, "llm_int8_has_fp16_weight": false, "llm_int8_skip_modules": null, "llm_int8_threshold": 6.0, "load_in_4bit": true, "load_in_8bit": false, "quant_method": "bitsandbytes" }, "rms_norm_eps": 1e-06, "rope_parameters": { "rope_theta": 10000.0, "rope_type": "default" }, "tie_word_embeddings": true, "transformers_version": "5.3.0.dev0", "unsloth_version": "2024.9", "use_bidirectional_attention": null, "use_cache": true, "vocab_size": 256000}123version https://git-lfs.github.com/spec/v1oid sha256:cc47c52667ff3390e0310e71cc0950f587816279c7d10279127595bd50bf7980size 5572141163123version https://git-lfs.github.com/spec/v1oid sha256:83d1a3e50bab7af7cffdab543ccf7ae59e629c8481a5f58dbcd4073c7d65d74bsize 3436291412345678910111213141516{ "backend": "tokenizers", "bos_token": "<bos>", "clean_up_tokenization_spaces": false, "eos_token": "<eos>", "is_local": false, "mask_token": "<mask>", "model_max_length": 1000000000000000019884624838656, "pad_token": "<pad>", "padding_side": "left", "sp_model_kwargs": {}, "spaces_between_special_tokens": false, "tokenizer_class": "GemmaTokenizer", "unk_token": "<unk>", "use_default_system_prompt": false}.gitattributes+1
README.mdAdded+57
chat_template.jinjaAdded+4
config.jsonAdded+48
model.safetensorsAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+16