Instructions to use RajGMore/tinyforge-llama3.1-8b-sql-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use RajGMore/tinyforge-llama3.1-8b-sql-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "RajGMore/tinyforge-llama3.1-8b-sql-lora") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from RajGMore/tinyforge-llama3.1-8b-sql-lora: direct link, hf CLI and curl.
- Browser
- Download file 1.83 kB
-
https://huggingface.co/RajGMore/tinyforge-llama3.1-8b-sql-lora/resolve/main/README.md
- Command line
-
hf download hf://RajGMore/tinyforge-llama3.1-8b-sql-lora/README.md
-
curl -L -o README.md https://huggingface.co/RajGMore/tinyforge-llama3.1-8b-sql-lora/resolve/main/README.md
1.83 kB
| base_model: meta-llama/Llama-3.1-8B-Instruct | |
| library_name: peft | |
| license: llama3.1 | |
| pipeline_tag: text-generation | |
| tags: | |
| - lora | |
| - peft | |
| - text-to-sql | |
| - tinyforge | |
| - low-vram | |
| # tinyforge: Llama-3.1-8B-Instruct LoRA for text-to-SQL, trained on a 4 GB GPU | |
| A 14 MB LoRA adapter (r=16) trained with [tinyforge](https://github.com/rajratangm/tinyforge) on a **4 GB RTX 3050 Ti laptop | |
| GPU** using layer streaming: 200 steps in 9.5 minutes. Training data: 1,800 question/SQL pairs over six public seaborn | |
| tables (titanic, mpg, tips, car_crashes, planets, healthexp), each answer verified by executing the SQL. | |
| Use under the Llama 3.1 Community License. | |
| ## Results (read the caveats) | |
| 100 questions about a table the model never saw (penguins), served with llama.cpp (adapter f16 on a Q4_K_M base), greedy decoding. | |
| | Model | Execution accuracy | | |
| |---|---| | |
| | This adapter | **100%** | | |
| | Base told to "reply with exactly one SQLite query" | 93% | | |
| Caveats, honestly: | |
| - 100% is a ceiling: the instructed base is already at 93%, so this test cannot show how much headroom tuning adds. | |
| All 7 base misses are one malformed `MAX`/`MIN` call, so the gain is **consistency, not new capability**. | |
| - Questions use the same 12 templates as training, on a new schema: it measures transfer to new tables, not new kinds of questions. | |
| - On harder question shapes the same 8B model scored 98% vs 97% (no meaningful gain over a well-prompted base). | |
| - n=100, one run, no confidence interval. Raw numbers: `eval_results.json`. | |
| ## Use | |
| ```python | |
| from transformers import AutoModelForCausalLM | |
| from peft import PeftModel | |
| base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct", device_map="auto") | |
| model = PeftModel.from_pretrained(base, "RajGMore/tinyforge-llama3.1-8b-sql-lora") | |
| ``` | |