This commit is contained in:
sex120 2025-03-28 05:50:47 +03:00 committed by GitHub
commit 099b25e77d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,18 @@
<!-- markdownlint-disable first-line-h1 --> from peft import LoraConfig, get_peft_model
# إعداد ضبط LoRA
peft_config = LoraConfig(
r=8,
lora_alpha=16,
target_modules=["q_proj", "v_proj"],
lora_dropout=0.05,
bias="none"
)
model = get_peft_model(model, peft_config)
# التدريب على بيانات مخصصة (مثال)
train_dataset = ["السؤال: كيف أفعل كذا؟\nالجواب: إليك الطريقة...", ...]<!-- markdownlint-disable first-line-h1 -->
<!-- markdownlint-disable html --> <!-- markdownlint-disable html -->
<!-- markdownlint-disable no-duplicate-header --> <!-- markdownlint-disable no-duplicate-header -->