Run this model with HF Jobs

Run Miguel0918/qlora-sqlcoder 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 and TRL to fine-tune https://huggingface.co/Miguel0918/qlora-sqlcoder. 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/Miguel0918/qlora-sqlcoder 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.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Miguel0918/qlora-sqlcoder. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/Miguel0918/qlora-sqlcoder. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
File size: 1,443 Bytes
5c023df
ea31246
 
 
 
 
 
 
 
 
 
5c023df
 
ea31246
5c023df
ea31246
5c023df
ea31246
5c023df
ea31246
5c023df
ea31246
 
 
5c023df
ea31246
5c023df
ea31246
5c023df
ea31246
 
 
5c023df
ea31246
 
5c023df
ea31246
 
 
 
 
 
 
 
5c023df
ea31246
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
license: cc-by-sa-4.0
base_model: defog/sqlcoder-7b-2
tags:
  - transformers
  - text-generation
  - sql
  - causal-lm
  - lora
  - qlora
  - peft
---

# 🦎 QLoRA SQLCoder — Fine-tuning de `defog/sqlcoder-7b-2`

Este repositório contém os **adapters LoRA** (formato PEFT) treinados com a técnica **QLoRA** sobre o modelo base [`defog/sqlcoder-7b-2`](https://huggingface.co/defog/sqlcoder-7b-2). O objetivo foi adaptar o modelo para melhor compreensão e geração de SQL em contextos específicos definidos pelo dataset fornecido.

---

## 📚 Modelo Base

- [`defog/sqlcoder-7b-2`](https://huggingface.co/defog/sqlcoder-7b-2)
- Arquitetura: LLaMA / causal LM
- Parâmetros: 7 bilhões

---

## 💡 Como Usar

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model = "defog/sqlcoder-7b-2"
adapter = "Miguel0918/qlora-sqlcoder"

tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    device_map="auto",
    load_in_4bit=True,
    torch_dtype="auto"
)
model = PeftModel.from_pretrained(model, adapter)

prompt = "portfolio_transaction_headers(...) JOIN portfolio_transaction_details(...): Find transactions for portfolio 72 involving LTC"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))