Downloads · 30 days
20
20% of all-time downloads
prathmesh-nik/Gemma-3-1B-Code-Alpaca-FT
Gemma-3-1B-Code-Alpaca-FT is a text generation model from prathmesh-nik. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
This is a fine-tuned version of the unsloth/gemma-3-1b-it model. It was fine-tuned by prathmesh-nik on the iamtarun/codeinstructions120kalpaca dataset to enhance its ability to follow instructions related to code gene…
Downloads · 30 days
20
20% of all-time downloads
All-time downloads
98
Public
Parameters
1000M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2 GB · 98%
From the Hugging Face model README
This is a fine-tuned version of the unsloth/gemma-3-1b-it model. It was fine-tuned by prathmesh-nik on the iamtarun/code_instructions_120k_alpaca dataset to enhance its ability to follow instructions related to code generation and general programming tasks.
config.json) specifies a theoretical maximum context of 32,768 tokens. However, it is based on unsloth/gemma-3-1b-it, which is optimized for an 8192 token context. Furthermore, this fine-tune was performed with a max_seq_length of only 2048 tokens. For best results, it is recommended to use this model with sequences close to the 2048 token training length.This model is designed for general-purpose instruction following, with a focus on coding assistance. It can be used for tasks such as:
You can use this model with the transformers library just like the base Gemma model.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Make sure you have logged in to huggingface-cli
# huggingface-cli login
model_id = "prathmesh_nik/Gemma-3-1B-Code-Alpaca-FT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16
)
chat = [
{ "role": "user", "content": "Write a Python function to calculate the factorial of a number." },
]
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)
outputs = model.generate(input_ids=inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
This model inherits the limitations and biases of the base unsloth/gemma-3-1b-it model and the training dataset.
This model was fine-tuned on the iamtarun/code_instructions_120k_alpaca dataset, which contains a large set of instruction-response pairs for coding tasks.
The model was fine-tuned using the LoRA (Low-Rank Adaptation) methodology. Key aspects of the training include:
bfloat16).This model was fine-tuned by prathmesh_nik. The complete source code for the fine-tuning process, including data preparation, training, and merging scripts, is available on GitHub.
Please cite the original Gemma 3 report if you use this model in your research:
@article{gemma_2025,
title={Gemma 3},
url={https://goo.gle/Gemma3Report},
publisher={Kaggle},
author={Gemma Team},
year={2025}
}