Downloads · 30 days
3
6% of all-time downloads
emohammadi97/gemma-3-4b-it-news-finetuned
gemma-3-4b-it-news-finetuned is a machine learning model from emohammadi97. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
این مدل نسخهی فاینتیونشده از Gemma-3-4B-IT است که با استفاده از روش LoRA (PEFT) برای تولید روایت ادغامی از اخبار چندزبانه (Multi-document News Fusion) آموزش داده شده است.
Downloads · 30 days
3
6% of all-time downloads
All-time downloads
49
Public
Repo size
55.9 MB
Likes
0
Public
Click a slice to open those files.
.json34.5 MB · 60%
From the Hugging Face model README
این مدل نسخهی فاینتیونشده از Gemma-3-4B-IT است که با استفاده از روش LoRA (PEFT) برای تولید روایت ادغامی از اخبار چندزبانه (Multi-document News Fusion) آموزش داده شده است.
[More Information Needed]
[More Information Needed]
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
You can use the code below to load the base Gemma model, attach the LoRA adapter, and generate text using the fine-tuned model.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# --------- تنظیمات مدل ---------
BASE_MODEL = "google/gemma-3-4b-it"
FINETUNED_MODEL = "emohammadi97/gemma-3-4b-it-news-finetuned"
# لود توکنایزر از ریپوی فاینتیونشده
tokenizer = AutoTokenizer.from_pretrained(FINETUNED_MODEL)
# لود مدل پایه
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
torch_dtype=torch.bfloat16,
device_map="auto"
).eval()
# اضافه کردن LoRA آداپترها
model = PeftModel.from_pretrained(base_model, FINETUNED_MODEL).eval()
# --------- نمونه پرامپت ---------
messages = [
{"role": "system", "content": "تو یک سیستم هوشمند تولید گزارشهای خبری ترکیبی هستی."},
{"role": "user", "content": """شما یک خبرنگار حرفهای هستید.
از خبرهای زیر یک گزارش خبری کامل و یکپارچه به زبان فارسی بنویسید.
- همه جزئیات مهم هر خبر باید در متن نهایی باشد (ادغام، نه خلاصهسازی).
- فقط وقتی میان خبرها اختلاف یا تناقض وجود دارد، به تفاوتها اشاره کنید.
- متن باید یک عنوان کوتاه و چند پاراگراف پیوسته داشته باشد، شبیه گزارش یک خبرگزاری معتبر.
- از تکرار یا بولتگذاری خودداری کنید.
- زبان رسمی و بیطرف باشد.
فهرست خبرها:
1. [اینجا متن خبر اول]
2. [اینجا متن خبر دوم]
3. [اینجا متن خبر سوم]"""}
]
# --------- تولید متن ---------
enc = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
with torch.inference_mode():
output = model.generate(enc, max_new_tokens=1024)
print(tokenizer.decode(output[0][enc.shape[1]:], skip_special_tokens=True))
## Training Details
### Training Data
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
[More Information Needed]
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Preprocessing [optional]
[More Information Needed]
#### Training Hyperparameters
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
[More Information Needed]
#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
[More Information Needed]
### Results
[More Information Needed]
#### Summary
## Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
[More Information Needed]
## Environmental Impact
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** [More Information Needed]
- **Hours used:** [More Information Needed]
- **Cloud Provider:** [More Information Needed]
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** [More Information Needed]
## Technical Specifications [optional]
### Model Architecture and Objective
[More Information Needed]
### Compute Infrastructure
[More Information Needed]
#### Hardware
[More Information Needed]
#### Software
[More Information Needed]
## Citation [optional]
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
**BibTeX:**
[More Information Needed]
**APA:**
[More Information Needed]
## Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
## More Information [optional]
[More Information Needed]
## Model Card Authors [optional]
[More Information Needed]
## Model Card Contact
[More Information Needed]
### Framework versions
- PEFT 0.10.0