Edit model card

INFERENCE CODE

pip install transformers[torch]
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
import time

tokenizer = AutoTokenizer.from_pretrained("AquilaX-AI/NL-PGSQL")
model = AutoModelForSeq2SeqLM.from_pretrained("AquilaX-AI/NL-PGSQL")

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

prefix = "Translate the following text to PGSQL: "
inp = YOUR_QUESTION

import time
start = time.time()

inputs = tokenizer(prefix + inp.lower(), return_tensors="pt")
model.to(device)
inputs = inputs.to(device)
outputs = model.generate(**inputs, max_length=256)
answer = tokenizer.decode(outputs[0]).replace('<pad>', '').replace('</s>', '').strip()
print(answer)

end = time.time()
print(f"Time taken: {end - start}")
Downloads last month
2,044
Safetensors
Model size
248M params
Tensor type
F32
·
Inference API
Unable to determine this model's library. Check the docs .