Downloads · 30 days
8
24% of all-time downloads
bhismaperkasa/gemma-3-270m-form-generator-fp16
gemma-3-270m-form-generator-fp16 is a machine learning model from bhismaperkasa. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Fine-tuned Gemma 3 270M model untuk generate form definitions dalam JSON format. Optimized untuk Android deployment dengan MediaPipe.
Downloads · 30 days
8
24% of all-time downloads
All-time downloads
33
Public
Parameters
436M
910 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors872 MB · 96%
From the Hugging Face model README
Fine-tuned Gemma 3 270M model untuk generate form definitions dalam JSON format.
Optimized untuk Android deployment dengan MediaPipe.
Model ini di-train TANPA quantization untuk compatibility dengan TFLite conversion dan Android deployment.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained(
"bhismaperkasa/gemma-3-270m-form-generator-fp16",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("bhismaperkasa/gemma-3-270m-form-generator-fp16")
# Generate form
messages = [
{"role": "system", "content": "You are a helpful assistant that generates form definitions in JSON format."},
{"role": "user", "content": "buatkan form login dengan email dan password"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(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)
Step 1: Convert to TFLite
# Clone training repo
git clone https://huggingface.co/bhismaperkasa/gemma-3-270m-form-generator-fp16
cd gemma-3-270m-form-generator-fp16
# Convert (requires ai-edge-torch)
python convert_to_tflite.py --model_path ./
Step 2: Integrate to Android
See full Android integration guide in training repository.
| Device | Init Time | Inference Time | Memory |
|---|---|---|---|
| Flagship (2024) | 2-3s | 1-2s | ~200MB |
| Mid-range (2023) | 3-5s | 2-4s | ~200MB |
| Budget (2022) | 5-8s | 4-8s | ~250MB |
buatkan form pendaftaran event dengan nama, email, dan nomor telepon
{
"id": "form_event_registration_001",
"title": "Form Pendaftaran Event",
"category": "registration",
"formDefinition": {
"sections": [
{
"sectionId": "section_1",
"title": "Informasi Peserta",
"fields": [
{
"fieldId": "nama_lengkap",
"label": "Nama Lengkap",
"fieldType": "TEXT",
"required": true
},
{
"fieldId": "email",
"label": "Email",
"fieldType": "EMAIL",
"required": true
},
{
"fieldId": "nomor_telepon",
"label": "Nomor Telepon",
"fieldType": "PHONE",
"required": true
}
]
}
]
}
}
Model ini di-train tanpa quantization (4-bit/8-bit) karena:
Trained on bhismaperkasa/form_dinamis
Full training code, conversion scripts, and Android integration guide:
Apache 2.0 (following Gemma base model license)
@misc{form-generator-gemma-android,
author = {bhismaperkasa},
title = {Form Generator - Gemma 3 270M (Android-Ready)},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/bhismaperkasa/gemma-3-270m-form-generator-fp16}}
}
For issues, questions, or contributions, please visit the training repository or open an issue.
Ready for production Android deployment! 🚀📱