Code for fine-tuning a language model to output SQL queries from natural language inputs.
- Open
sql-finetuning.ipynb
. - Change your runtime to GPU.
- Run the notebook.
If you prefer to run the notebook locally, follow these steps to set up a virtual environment:
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
# On macOS and Linux source venv/bin/activate # On Windows .\venv\Scripts\activate
Note: You do not need a virtual environment on Google Colab.
Ensure you have access to a GPU, as training will take a long time without one.
If you don't want to train the model yourself, you can download the pre-trained weights for inference: