Skip to content

DanielGnzlzVll/NL2SQLApp

Repository files navigation

NL2SQLApp

This is a simple application which attempts to test natural language to SQL technique.

Setup

Follow these steps to set up and run the application:

  1. Requirements: Ensure you have the following dependencies installed:

    • docker
    • make
  2. Start the project:

    • Open a terminal in the root directory of your project.
    • Execute the following command to initiate the project setup:
      make start
  3. Populate the Database:

    After the database is created and necessary models are downloaded, proceed with the following steps:

    • Start a bash session in the main container using:

      make up
    • Once inside the container, populate the database by running:

      python manage.py load_data tsla_2014_2023.csv

    You can load any files available in the root repository.

  4. Start the web server: After ensuring everything is properly set up, initiate the web server by running:

    make runserver

Testing the web page

There is a web page which can be used to ask to the model. Just open a web browser and navigate to http://localhost:8000/chat/ and ask any question. image

Testing the api

To test the application, follow these steps:

  1. Access the application:

  2. Choosing the model:

Warning

Don't forget pulling the models by running the make start command once you have changed the models list.

export AVAILABLE_MODELS=llama2,mistral
make start
make runserver

Project decisions:

This project has the following decisions or conditions:

  1. Django is use since it is easy to create the database schema and maintain its changes.
  2. No async code is used because django does not support async code for transactions currently.
  3. Ollama is used because it provided a wide variety of models, and i can be change to OpenIA's api easily.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published