Downloads · 30 days
7
35% of all-time downloads
bhismaperkasa/form-generator-lora-adapters
form-generator-lora-adapters is a text generation model from bhismaperkasa. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Fine-tuned LoRA adapters for google/gemma-3-270m-it to generate form definitions in JSON format from natural language descriptions in Bahasa Indonesia.
Downloads · 30 days
7
35% of all-time downloads
All-time downloads
20
Public
Repo size
6.2 GB
Likes
0
Public
Click a slice to open those files.
.pt4.1 GB · 59%
From the Hugging Face model README
Fine-tuned LoRA adapters for google/gemma-3-270m-it to generate form definitions in JSON format from natural language descriptions in Bahasa Indonesia.
This repository contains LoRA adapters (not a merged model) that can be loaded on top of the base Gemma 3 270M model. The adapters were trained to generate dynamic form definitions in JSON format.
This is a LoRA adapter model, NOT a standalone model. You need to load it together with the base model google/gemma-3-270m-it.
pip install transformers peft torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"google/gemma-3-270m-it",
device_map="auto",
torch_dtype=torch.bfloat16
)
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "bhismaperkasa/form-generator-lora-adapters")
tokenizer = AutoTokenizer.from_pretrained("bhismaperkasa/form-generator-lora-adapters")
# Generate
messages = [
{"role": "system", "content": "You are a helpful assistant that generates form definitions in JSON format based on user requests."},
{"role": "user", "content": "buatkan form pendaftaran event dengan nama dan email"}
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
do_sample=True
)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
generated = result.split("<start_of_turn>model\n")[-1].strip()
print(generated)
Input:
buatkan form login sederhana
Output:
{
"id": "form_login_sims",
"title": "Form Login",
"description": "Form untuk login akun",
"formDefinition": {
"fields": [
{"fieldId": "email", "label": "Email", "fieldType": "EMAIL", "required": true},
{"fieldId": "password", "label": "Password", "fieldType": "PASSWORD", "required": true}
]
}
}
@misc{form-generator-gemma-lora,
author = {bhismaperkasa},
title = {Form Generator - Gemma 3 270M LoRA Adapters},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/bhismaperkasa/form-generator-lora-adapters}}
}
This model is based on Gemma 3 270M which is licensed under Apache 2.0.
Note: For production use, consider using these adapters instead of a merged model for better reliability and performance.