Run this model with HF Jobs

Run vagmi/squeal 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/vagmi/squeal. 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/vagmi/squeal 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/vagmi/squeal. 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/vagmi/squeal. 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.
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="vagmi/squeal")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("vagmi/squeal")
model = AutoModelForCausalLM.from_pretrained("vagmi/squeal", device_map="auto")
Quick Links

Generate SQL from text - Squeal

Please use the code below as an example for how to use this model.

import torch
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

def load_model(model_name):
    # Load tokenizer and model with QLoRA configuration
    compute_dtype = getattr(torch, 'float16')

    bnb_config = BitsAndBytesConfig(
        load_in_4bit=True,
        bnb_4bit_quant_type='nf4',
        bnb_4bit_compute_dtype=compute_dtype,
        bnb_4bit_use_double_quant=False,
    )

    model = AutoModelForCausalLM.from_pretrained(
        model_name,
        device_map={"": 0},
        quantization_config=bnb_config
    )


    # Load Tokenizer
    tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
    tokenizer.pad_token = tokenizer.eos_token
    tokenizer.padding_side = "right"

    return model, tokenizer

model, tokenizer = load_model('vagmi/squeal')

prompt = "<s>[INST] Output SQL for the given table structure \n \
  CREATE TABLE votes (contestant_number VARCHAR, num_votes int); \
  CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR); \
  What is the contestant number and name of the contestant who got least votes?[/INST]"
pipe = pipeline(task="text-generation", 
                model=model, 
                tokenizer=tokenizer, 
                max_length=200,
                device_map='auto', )
result = pipe(prompt)
print(result[0]['generated_text'][len(prompt):-1])

How I built it?

Watch me build this model.

https://www.youtube.com/watch?v=PNFhAfxR_d8

Here is the notebook I used to train this model.

https://colab.research.google.com/drive/1jYX8AlRMTY7F_dH3hCFM4ljg5qEmCoUe#scrollTo=IUILKaGWhBxS

Downloads last month
15
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train vagmi/squeal