Downloads · 30 days
19
28% of all-time downloads
ppm-pt/gemma-2-nb-2b-it
gemma-2-nb-2b-it is a text generation model from ppm-pt. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
- Model Name: ppm-pt/gemma-2-nb-2b-it - Base Model: google/gemma-2-2b-it - Fine-Tuned On: NbAiLab/norwegian-alpaca - Model Type: Instruction-tuned Causal Language Model - Architecture: Transformer-based - Languages: M…
Downloads · 30 days
19
28% of all-time downloads
All-time downloads
68
Public
Parameters
2.6B
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.2 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of Google's gemma-2-2b-it, a 2.2-billion-parameter instruction-tuned language model. The "it" in the model name stands for "instruct," indicating that the base model is trained to follow instructions across multiple tasks and potentially multiple languages. The fine-tuning process was performed using the NbAiLab/norwegian-alpaca dataset, which contains Norwegian instruction-following data.
The model leverages parameter-efficient fine-tuning (PEFT) techniques, specifically Low-Rank Adaptation (LoRA), and utilizes 4-bit quantization to optimize memory usage and computational efficiency.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
The model is designed for generating Norwegian text for tasks such as:
- Instruction Following: Responding to user instructions in Norwegian.
- Text Generation: Generating coherent and contextually relevant Norwegian text.
- Conversational AI: Building chatbots or virtual assistants that communicate in Norwegian.
The model is fine-tuned from google/gemma-2-2b-it, and as such, all use must be according to the Gemma Terms of Use. The training data NbAiLab/norwegian-alpaca is generated using GPT-3.5, and therefore this model can not be used to compete against OpenAI in any way, shape, or form.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
#Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("ppm-pt/gemma-2-nb-2b-it", use_fast=True)
model = AutoModelForCausalLM.from_pretrained("ppm-pt/gemma-2-nb-2b-it", torch_dtype="auto")
#Prepare input text
input_text = "Hva er hovedstaden i Norge?"
input_ids = tokenizer.encode(input_text, return_tensors='pt')
#Generate output
output_ids = model.generate(input_ids, max_length=50, num_return_sequences=1)
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(output_text)
NbAiLab/norwegian-alpaca
Frameworks Used:
Training Configuration
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type='nf4',
)
config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=modules,
lora_dropout=0.05,
bias='none',
task_type='CAUSAL_LM',
)
Training Argumens:
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
sbdyrnes