Run this model with HF Jobs
Run alwang/gemma-text-to-sql on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/alwang/gemma-text-to-sql. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/alwang/gemma-text-to-sql on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use alwang/gemma-text-to-sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alwang/gemma-text-to-sql with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("alwang/gemma-text-to-sql", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Training in progress, epoch 1
Browse filesFiles changed (12)
- .gitattributes+1
- README.mdAdded+58
- adapter_config.jsonAdded+40
- adapter_model.safetensorsAdded+3
- added_tokens.jsonAdded+3
- chat_template.jinjaAdded+47
- runs/Jan04_17-22-07_58ff930f91d5/events.out.tfevents.1767547352.58ff930f91d5.5907.0Added+3
- special_tokens_map.jsonAdded+33
- tokenizer.jsonAdded+3
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded
- training_args.binAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758---base_model: google/gemma-3-1b-ptlibrary_name: transformersmodel_name: gemma-text-to-sqltags:- generated_from_trainer- sft- trllicence: license---
# Model Card for gemma-text-to-sql
This model is a fine-tuned version of [google/gemma-3-1b-pt](https://huggingface.co/google/gemma-3-1b-pt).It has been trained using [TRL](https://github.com/huggingface/trl).
## Quick start
```pythonfrom transformers import pipeline
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"generator = pipeline("text-generation", model="alwang/gemma-text-to-sql", device="cuda")output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]print(output["generated_text"])```
## Training procedure
This model was trained with SFT.
### Framework versions
- TRL: 0.21.0- Transformers: 4.57.3- Pytorch: 2.9.0+cu126- Datasets: 3.3.2- Tokenizers: 0.22.1
## Citations
Cite TRL as: ```bibtex@misc{vonwerra2022trl, title = {{TRL: Transformer Reinforcement Learning}}, author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec}, year = 2020, journal = {GitHub repository}, publisher = {GitHub}, howpublished = {\url{https://github.com/huggingface/trl}}}```12345678910111213141516171819202122232425262728293031323334353637383940{ "alpha_pattern": {}, "auto_mapping": null, "base_model_name_or_path": "google/gemma-3-1b-pt", "bias": "none", "eva_config": null, "exclude_modules": null, "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 16, "lora_bias": false, "lora_dropout": 0.05, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": [ "lm_head", "embed_tokens" ], "peft_type": "LORA", "r": 16, "rank_pattern": {}, "revision": null, "target_modules": [ "up_proj", "o_proj", "q_proj", "k_proj", "gate_proj", "down_proj", "v_proj" ], "task_type": "CAUSAL_LM", "use_dora": false, "use_rslora": false}123version https://git-lfs.github.com/spec/v1oid sha256:c5c7e62713cf65837d19e5fcec80ca05d25ad0884944bf8e399a6d3d7e8c0ce1size 2468152240123{ "<image_soft_token>": 262144}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647{{ bos_token }}{%- if messages[0]['role'] == 'system' -%} {%- if messages[0]['content'] is string -%} {%- set first_user_prefix = messages[0]['content'] + '
' -%} {%- else -%} {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
' -%} {%- endif -%} {%- set loop_messages = messages[1:] -%}{%- else -%} {%- set first_user_prefix = "" -%} {%- set loop_messages = messages -%}{%- endif -%}{%- for message in loop_messages -%} {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%} {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }} {%- endif -%} {%- if (message['role'] == 'assistant') -%} {%- set role = "model" -%} {%- else -%} {%- set role = message['role'] -%} {%- endif -%} {{ '<start_of_turn>' + role + '' + (first_user_prefix if loop.first else "") }} {%- if message['content'] is string -%} {{ message['content'] | trim }} {%- elif message['content'] is iterable -%} {%- for item in message['content'] -%} {%- if item['type'] == 'image' -%} {{ '<start_of_image>' }} {%- elif item['type'] == 'text' -%} {{ item['text'] | trim }} {%- endif -%} {%- endfor -%} {%- else -%} {{ raise_exception("Invalid content type") }} {%- endif -%} {{ '<end_of_turn>' }}{%- endfor -%}{%- if add_generation_prompt -%} {{'<start_of_turn>model'}}{%- endif -%}123version https://git-lfs.github.com/spec/v1oid sha256:8180adb77b6aa343a68da123d5a0fab129229e95f05a12546221ff6e6f8fbefasize 43214123456789101112131415161718192021222324252627282930313233{ "boi_token": "<start_of_image>", "bos_token": { "content": "<bos>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eoi_token": "<end_of_image>", "eos_token": { "content": "<eos>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "image_token": "<image_soft_token>", "pad_token": { "content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123version https://git-lfs.github.com/spec/v1oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795size 33384568123version https://git-lfs.github.com/spec/v1oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79csize 4689074123version https://git-lfs.github.com/spec/v1oid sha256:70a421207574a2c2372d47f2a72fdb5baf4912fbbd0da1a815da0fe88e7427d9size 6289.gitattributes+1
README.mdAdded+58
adapter_config.jsonAdded+40
adapter_model.safetensorsAdded+3
added_tokens.jsonAdded+3
chat_template.jinjaAdded+47
runs/Jan04_17-22-07_58ff930f91d5/events.out.tfevents.1767547352.58ff930f91d5.5907.0Added+3
special_tokens_map.jsonAdded+33
tokenizer.jsonAdded+3
tokenizer.modelAdded+3
tokenizer_config.jsonAdded
training_args.binAdded+3