Downloads · 30 days
10
17% of all-time downloads
Svngoku/aya-23-8b-afrimmlu-lin
aya-23-8b-afrimmlu-lin is a text generation model from Svngoku. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
10
17% of all-time downloads
All-time downloads
58
Public
Repo size
122 MB
Likes
0
Public
Click a slice to open those files.
.safetensors109 MB · 89%
From the Hugging Face model README
This model is a fine-tuned version of CohereForAI/aya-23-8b on Masakhane/afrimmlu.
More information needed
More information needed
def formatting_prompts_func(example):
output_texts = []
for i in range(len(example['choices'])):
text = f"<|START_OF_TURN_TOKEN|><|USER_TOKEN|>Question : {example['question'][i]}, Choices : {example['choices'][i]}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{example['answer'][i]}"
output_texts.append(text)
return output_texts
PeftModelForCausalLM(
(base_model): LoraModel(
(model): CohereForCausalLM(
(model): CohereModel(
(embed_tokens): Embedding(256000, 4096, padding_idx=0)
(layers): ModuleList(
(0-31): 32 x CohereDecoderLayer(
(self_attn): CohereAttention(
(q_proj): lora.Linear4bit(
(base_layer): Linear4bit(in_features=4096, out_features=4096, bias=False)
(lora_dropout): ModuleDict(
(default): Identity()
)
(lora_A): ModuleDict(
(default): Linear(in_features=4096, out_features=32, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=32, out_features=4096, bias=False)
)
(lora_embedding_A): ParameterDict()
(lora_embedding_B): ParameterDict()
)
(k_proj): lora.Linear4bit(
(base_layer): Linear4bit(in_features=4096, out_features=1024, bias=False)
(lora_dropout): ModuleDict(
(default): Identity()
)
(lora_A): ModuleDict(
(default): Linear(in_features=4096, out_features=32, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=32, out_features=1024, bias=False)
)
(lora_embedding_A): ParameterDict()
(lora_embedding_B): ParameterDict()
)
(v_proj): lora.Linear4bit(
(base_layer): Linear4bit(in_features=4096, out_features=1024, bias=False)
(lora_dropout): ModuleDict(
(default): Identity()
)
(lora_A): ModuleDict(
(default): Linear(in_features=4096, out_features=32, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=32, out_features=1024, bias=False)
)
(lora_embedding_A): ParameterDict()
(lora_embedding_B): ParameterDict()
)
(o_proj): lora.Linear4bit(
(base_layer): Linear4bit(in_features=4096, out_features=4096, bias=False)
(lora_dropout): ModuleDict(
(default): Identity()
)
(lora_A): ModuleDict(
(default): Linear(in_features=4096, out_features=32, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=32, out_features=4096, bias=False)
)
(lora_embedding_A): ParameterDict()
(lora_embedding_B): ParameterDict()
)
(rotary_emb): CohereRotaryEmbedding()
)
(mlp): CohereMLP(
(gate_proj): Linear4bit(in_features=4096, out_features=14336, bias=False)
(up_proj): Linear4bit(in_features=4096, out_features=14336, bias=False)
(down_proj): Linear4bit(in_features=14336, out_features=4096, bias=False)
(act_fn): SiLU()
)
(input_layernorm): CohereLayerNorm()
)
)
(norm): CohereLayerNorm()
)
(lm_head): Linear(in_features=4096, out_features=256000, bias=False)
)
)
)
The following hyperparameters were used during training:
quantization_config = None
if QUANTIZE_4BIT:
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16,
)
attn_implementation = None
if USE_FLASH_ATTENTION:
attn_implementation="flash_attention_2"
loaded_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL_NAME,
quantization_config=quantization_config,
attn_implementation=attn_implementation,
torch_dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME)
loaded_model.load_adapter("aya-23-8b-afrimmlu-lin")
prompts = [
"""Question: 4 na 3 Ezali boni ?
Choices : [12, 4, 32, 21]
"""
]
generations = generate_aya_23(prompts, loaded_model)
for p, g in zip(prompts, generations):
print(
"PROMPT", p ,"RESPONSE", g, "\n", sep="\n"
)
PROMPT
Question: 4 na 3 Ezali boni ?
Choices : [12, 4, 32, 21]
RESPONSE
Boni ya 4 ezali 12.