Downloads · 30 days
0
MedAliFarhat/Tunisia-Banking-Compliance-Gemma
Tunisia-Banking-Compliance-Gemma is a machine learning model from MedAliFarhat. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Feb 1, 2026
Repo size
34.3 MB
Likes
0
Public
Click a slice to open those files.
.json34.3 MB · 100%
From the Hugging Face model README
![Project Logo]
A LoRA adapter for the Gemma-2B model fine-tuned on Tunisian banking regulations and compliance tasks. This adapter allows the base google/gemma-2b model to answer legal questions, reference specific articles, and assist with compliance-related inquiries.
bnb_4bit_compute_dtype=torch.bfloat16)SFTTrainerfrom transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
# 4-bit quantization config
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16
)
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"google/gemma-2b",
quantization_config=bnb_config,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "path_to_outputs_compliance")
tokenizer = AutoTokenizer.from_pretrained("path_to_outputs_compliance")
# Generate predictions
input_text = "Quelle est la réglementation pour les prêts bancaires aux entreprises en Tunisie ?"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))