Downloads · 30 days
7
23% of all-time downloads
bhismaperkasa/gemma-3-1B-it-form-generator-q4_4096
gemma-3-1B-it-form-generator-q4_4096 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.
Complete merged model untuk generate form definitions dalam JSON format. Siap untuk Android deployment dengan TFLite conversion.
Downloads · 30 days
7
23% of all-time downloads
All-time downloads
31
Public
Parameters
1000M
4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4 GB · 99%
From the Hugging Face model README
Complete merged model untuk generate form definitions dalam JSON format. Siap untuk Android deployment dengan TFLite conversion.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained(
"bhismaperkasa/gemma-3-1B-it-form-generator-q4_4096",
torch_dtype=torch.bfloat16, # Use BF16 for PyTorch 2.5+
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("bhismaperkasa/gemma-3-1B-it-form-generator-q4_4096")
model.eval()
# Generate
prompt = "<start_of_turn>user\nbuatkan form login<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.95,
top_k=64,
do_sample=True
)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result.split("<start_of_turn>model\n")[-1])
Step 1: Convert to TFLite
# Install ai-edge-torch
pip install ai-edge-torch ai-edge-torch-generative
# Convert
python convert_to_tflite.py --model_path=./gemma-3-1B-it-form-generator-q4_4096
Step 2: Use in Android
// Load TFLite model
val model = Model.createModel(context, "model_int8.tflite")
// Run inference
val output = model.generate("buatkan form login")
Input:
buatkan form pendaftaran event dengan nama, email, dan nomor telepon
Output:
{
"id": "form_event_registration",
"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 trained without 4-bit/8-bit quantization because:
Apache 2.0 (following Gemma license)
Ready for production Android deployment! 🚀📱