How to use from
Unsloth Studio
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for Majipa/text-to-SQL to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for Majipa/text-to-SQL to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required
# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for Majipa/text-to-SQL to start chatting
Load model with FastModel
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
    model_name="Majipa/text-to-SQL",
    max_seq_length=2048,
)
Quick Links

Uploaded model

  • Developed by: Majipa
  • License: apache-2.0
  • Finetuned from model : unsloth/phi-3-mini-4k-instruct-bnb-4bit

This mistral model was trained 2x faster with Unsloth and Huggingface's TRL library.

Using the model

from transformers import AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_4bit=True)

model = AutoModelForCausalLM.from_pretrained("Majipa/text-to-SQL",
                                             device_map="cuda",
                                             torch_dtype="auto",
                                             quantization_config=quantization_config)
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline 

tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct") 

messages = [ 
    {"role": "system", "content": "You are a helpful text-to-SQL assistant."}, 
    {"role": "user", "content": "question: How many heads of the departments are older than 56 ? context: CREATE TABLE head (age INTEGER)"}, 
] 

pipe = pipeline( 
    "text-generation", 
    model=model, 
    tokenizer=tokenizer, 
) 

generation_args = { 
    "max_new_tokens": 500, 
    "temperature": 0.7, 
} 

output = pipe(messages, **generation_args) 
print(output[0]['generated_text'])
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support