Downloads · 30 days
9
29% of all-time downloads
deepak2310/gemma-2b-english-quotes
gemma-2b-english-quotes is a text generation model from deepak2310. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
A LoRA fine-tuned version of Google's Gemma 2B language model, trained on an English quotes dataset. This model is designed to generate and continue English quotes in a quote-and-author format.
Downloads · 30 days
9
29% of all-time downloads
All-time downloads
31
Public
Repo size
54 MB
Likes
0
Public
Click a slice to open those files.
.json34.4 MB · 64%
From the Hugging Face model README
A LoRA fine-tuned version of Google's Gemma 2B language model, trained on an English quotes dataset. This model is designed to generate and continue English quotes in a quote-and-author format.
This model was fine-tuned on an English quotes dataset using the Google Gemma 2B base model. The training uses Low-Rank Adaptation (LoRA), allowing the model to learn from the quotes dataset without updating all the parameters of the base model.
The model is intended for experimentation with language model fine-tuning, quote generation, and understanding how parameter-efficient fine-tuning works.
This model can be used for:
Quote: Be who you are and say what you feel,
The model can be prompted to continue the quote or generate similar text.
This model should not be used for:
pip install transformers peft torch
This repository contains LoRA adapter weights. Load the base Gemma model together with the adapter.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = "google/gemma-2b"
adapter_model = "deepak2310/gemma-2b-english-quotes"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.float32,
device_map="auto"
)
model = PeftModel.from_pretrained(
model,
adapter_model
)
model.eval()
prompt = "Quote: Be who you are and say what you feel,"
inputs = tokenizer(
prompt,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=50,
do_sample=True,
temperature=0.7,
top_p=0.9
)
print(
tokenizer.decode(
outputs[0],
skip_special_tokens=True
)
)
The model was fine-tuned on an English quotes dataset containing quote and author fields.
The training examples were formatted as:
Quote: {quote}
Author: {author}
The dataset contains approximately 2,508 training examples.
The model was trained using:
| Parameter | Value |
|---|---|
| Per-device batch size | 1 |
| Gradient accumulation steps | 4 |
| Effective batch size | 4 |
| Warmup steps | 2 |
| Maximum training steps | 100 |
| Learning rate | 2e-4 |
| Optimizer | paged_adamw_8bit |
| FP16 | False |
| BF16 | False |
| Logging steps | 1 |
| Training loss | 2.1305582690238953 |
The model was tested with manually selected quote prompts to observe its generated outputs.
Example prompt:
Quote: I'm selfish,
Another prompt:
Quote: Be who you are and say what you feel,
The model successfully generated text continuations for the tested prompts.
However, no formal evaluation metrics such as BLEU, ROUGE, or perplexity on a held-out test set have been calculated.
Therefore, the model's performance should be considered preliminary.
This repository contains the LoRA adapter weights and tokenizer files.
Typical files include:
adapter_config.jsonadapter_model.safetensorstokenizer.jsontokenizer_config.jsontraining_args.binREADME.mdNote: This repository contains adapter weights rather than a fully merged Gemma model. The original Gemma 2B base model is required to load the adapter.
This model is based on Google's Gemma 2B model and is subject to the Gemma license.
Users should review the original Gemma license and its terms before using or redistributing this model.
Base model: google/gemma-2b
Deepak Singh
Hugging Face: deepak2310
If you use this model in your project, please reference the model repository:
@misc{deepak_gemma_2b_english_quotes,
author = {Deepak Singh},
title = {Gemma 2B English Quotes},
year = {2026},
publisher = {Hugging Face},
howpublished = {
https://huggingface.co/deepak2310/gemma-2b-english-quotes
}
}