Text Generation
Transformers
PyTorch
Safetensors
English
t5
text2text-generation
text2sql
conversational
text-generation-inference
Instructions to use gaussalgo/T5-LM-Large-text2sql-spider with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gaussalgo/T5-LM-Large-text2sql-spider with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gaussalgo/T5-LM-Large-text2sql-spider") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("gaussalgo/T5-LM-Large-text2sql-spider") model = AutoModelForSeq2SeqLM.from_pretrained("gaussalgo/T5-LM-Large-text2sql-spider", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gaussalgo/T5-LM-Large-text2sql-spider with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gaussalgo/T5-LM-Large-text2sql-spider" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gaussalgo/T5-LM-Large-text2sql-spider", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gaussalgo/T5-LM-Large-text2sql-spider
- SGLang
How to use gaussalgo/T5-LM-Large-text2sql-spider with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gaussalgo/T5-LM-Large-text2sql-spider" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gaussalgo/T5-LM-Large-text2sql-spider", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gaussalgo/T5-LM-Large-text2sql-spider" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gaussalgo/T5-LM-Large-text2sql-spider", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gaussalgo/T5-LM-Large-text2sql-spider with Docker Model Runner:
docker model run hf.co/gaussalgo/T5-LM-Large-text2sql-spider
Commit History
-
Update README.md
Verified signaturef0a1f3e
-
Add chat_template to tokenizer_config.json (#4)
Verified signature- Add chat_template to tokenizer_config.json (f22d13ab07b8ce8dfff59bb5f501fc4289f13456) Co-authored-by: Rafael Wanderley de Holanda <rafaelwh@users.noreply.huggingface.co>c43e300
-
Update README.md
Verified signaturef08147b
-
Create train_txt2sql.py
Verified signature52943d3
-
Upload requirements.txt
a707b30 -
Upload sqlite_parser.py
script for creating your own db_schemas.json from your own sql files.698d7e3
-
Update README.md
b347b07
-
Update README.md
cbda07a
-
Update README.md
6ce602e -
add eval results
9b6d20d -
Update README.md
bd56e01 -
Update README.md
57fed75 -
evaluate script
23ceea2
-
Update README.md
5068739 -
Update README.md
9477969 -
Update README.md
7c7f877 -
Update README.md
d74368d -
Update README.md
9b15226 -
Update README.md
34b6dc2 -
Update README.md
75ee931 -
Create README.md
# T5 large LM Adapt for Text to SQL This model is fine-tuned from the [t5-large-LM-adapt](https://huggingface.co/google/t5-large-lm-adapt) checkpoint. ## Spider and Spider-Syn dataset The model was fine-tuned on the training splits of [Spider](https://yale-lily.github.io/spider) and [Spider-Syn](https://github.com/ygan/Spider-Syn/tree/main/Spider-Syn) datasets. Instead of using only the questions, we added the database schema to the question, as we wanted the model to generate a question over a given database _input_: ``` Question: What is the average, minimum, and maximum age for all French musicians? Schema: "stadium" "Stadium_ID" int , "Location" text , "Name" text , "Capacity" int , "Highest" int , "Lowest" int , "Average" int , foreign_key: primary key: "Stadium_ID" [SEP] "singer" "Singer_ID" int , "Name" text , "Country" text , "Song_Name" text , "Song_release_year" text , "Age" int , "Is_male" bool , foreign_key: primary key: "Singer_ID" [SEP] "concert" "concert_ID" int …fa778e5
-
Adding `safetensors` variant of this model (#1)
- Adding `safetensors` variant of this model (ac7861709796d65fe3586a3453495a53b6d397b1) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>5c517ea
-
Upload T5ForConditionalGeneration
73c2f79 -
Upload tokenizer
9697050 -
initial commit
2a21ed7