Downloads · 30 days
43
12% of all-time downloads
PLTAT/waray_llama_3.1_FT_8B_GGUF
waray_llama_3.1_FT_8B_GGUF is a machine learning model from PLTAT. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama3.1.
Our mission is to preserve, elevate, and promote Philippine native languages through the power of Artificial Intelligence. By creating and open-sourcing AI models for underrepresented local languages, we aim to bridge…
Downloads · 30 days
43
12% of all-time downloads
All-time downloads
347
Public
Repo size
8.5 GB
Likes
1
Public
Click a slice to open those files.
.gguf8.5 GB · 100%
From the Hugging Face model README
Our mission is to preserve, elevate, and promote Philippine native languages through the power of Artificial Intelligence. By creating and open-sourcing AI models for underrepresented local languages, we aim to bridge the digital language divide, ensure our cultural heritage thrives in the digital age, and empower local communities.
Please support this mission and our continuous work by contributing to the PLTAT (Philippine Language Translation and AI Training) Fund.
This repository contains GGUF format model files for Llama-3.1-8B-Waray, a fine-tuned version of Meta's LLaMA 3.1 (8 Billion parameters) designed to understand and generate text in Waray (Waray-Waray), an Austronesian language primarily spoken in the Eastern Visayas region of the Philippines, specifically in the provinces of Samar, Northern Samar, Eastern Samar, Leyte, and Biliran.
Note on Training: This model was fine-tuned using the Alpaca dataset format. For the best responses, you must use the Alpaca prompt template when interacting with it.
These GGUF files are highly optimized for inference on consumer hardware (both CPU and GPU) using tools like llama.cpp, LM Studio, Ollama, and text-generation-webui.
You can easily run this model locally using Ollama. Ensure you have Ollama installed, and then run the following command in your terminal to chat with the model:
ollama run welyjesch/waray-llama-3
Ollama Hub Link:ollama.com/welyjesch/waray-llama-3
Because this model was trained on an Alpaca-formatted dataset, you should structure your prompts like this.
Without Input:
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:[Your Waray instruction here]
### Response:
With Context/Input:
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
[Your Waray instruction here]
### Input:
[Optional context here]
### Response:
You can easily use the lora version of this through Unsloth, which is faster and easier, because I've provided a python notebook you can open in Colab: Waray Llama 3.1 Inference Notebook
You can easily run this GGUF model in the free tier of Google Colab using llama-cpp-python with hardware acceleration.
# 1. Install llama-cpp-python with CUDA (GPU) support
!CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python
!pip install huggingface_hub
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
# 2. Download the GGUF model from Hugging Face
repo_id = "welyjesch/waray_llama_3.1_FT_8B_GGUF"
filename = "llama-3.1-8b-waray-alpaca-q4_k_m.gguf"
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
# 3. Load the model
llm = Llama(
model_path=model_path,
n_gpu_layers=-1, # Offloads all layers to the GPU
n_ctx=2048, # Context window size
verbose=False
)
# 4. Run Inference using the Alpaca Prompt Format
prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Kumusta ka yana nga adlaw? May-ada ka ba maupay nga sumat?
### Response:
"""
output = llm(
prompt,
max_tokens=256,
temperature=0.7,
top_p=0.9,
stop=["<|end_of_text|>", "<|eot_id|>"] # Standard Llama 3 end tokens
)
print(output["choices"][0]["text"])
Unsloth recently introduced Unsloth Studio, a powerful graphical interface that makes fine-tuning incredibly easy and fast without writing code. Here is how you can further fine-tune this model using the Studio:
meta-llama/Meta-Llama-3.1-8B as your base model.Note: You cannot easily fine-tune a .gguf file directly. To do further code-based fine-tuning, you should use the original unquantized model weights (Safetensors) using Unsloth, which allows you to fine-tune LLaMA 3.1 8B on a free Colab T4 GPU.
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes
from unsloth import FastLanguageModel
import torch
from trl import SFTTrainer
from transformers import TrainingArguments
from datasets import load_dataset
max_seq_length = 2048
dtype = None # Auto detection
load_in_4bit = True # 4bit quantization to save memory
# 1. Load the BASE model (Not the GGUF, but the Safetensors repo)
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "welyjesch/waray_llama_3.1_finetuned_lora",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
# 2. Add LoRA adapters
model = FastLanguageModel.get_peft_model(
model,
r = 16,
target_modules =["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
lora_alpha = 16,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth",
random_state = 3407,
)
# 3. Format dataset to Alpaca
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
EOS_TOKEN = tokenizer.eos_token
def formatting_prompts_func(examples):
instructions = examples["instruction"]
inputs = examples["input"]
outputs = examples["output"]
texts =[]
for instruction, input, output in zip(instructions, inputs, outputs):
text = alpaca_prompt.format(instruction, input, output) + EOS_TOKEN
texts.append(text)
return { "text" : texts, }
# Load and format your new Waray dataset
dataset = load_dataset("json", data_files="your_new_waray_alpaca_data.json", split="train")
dataset = dataset.map(formatting_prompts_func, batched = True,)
# 4. Setup Trainer
trainer = SFTTrainer(
model = model,
tokenizer = tokenizer,
train_dataset = dataset,
dataset_text_field = "text",
max_seq_length = max_seq_length,
dataset_num_proc = 2,
args = TrainingArguments(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4,
warmup_steps = 5,
max_steps = 60, # Increase this for actual training
learning_rate = 2e-4,
fp16 = not torch.cuda.is_bf16_supported(),
bf16 = torch.cuda.is_bf16_supported(),
logging_steps = 1,
optim = "adamw_8bit",
weight_decay = 0.01,
lr_scheduler_type = "linear",
seed = 3407,
output_dir = "outputs",
),
)
# 5. Start Training
trainer_stats = trainer.train()
# 6. Save the new model and export back to GGUF
model.save_pretrained_gguf("model", tokenizer, quantization_method = "q4_k_m")
# You can then upload the resulting GGUF file back to Hugging Face
While this model has been fine-tuned to understand and generate Waray, it is still subject to the limitations of its base model (LLaMA 3.1).
This model was finetuned and converted to GGUF format using Unsloth.
Example usage:
llama-cli -hf welyjesch/waray_llama_3.1_FT_8B_GGUF --jinjallama-mtmd-cli -hf welyjesch/waray_llama_3.1_FT_8B_GGUF --jinjallama-3.1-8b.Q8_0.gguf
This was trained 2x faster with Unsloth<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>