Git Product home page Git Product logo

text2sql_prompt's Introduction

Text2SQL_prompt

A Generative AI based project deployed through Streamlit Framework.

Application:

image

Installation:

Before proceeding to steps make sure you have: Anaconda Navigator, VS Code with C++ Redistributable as LLamaCPP utilised cpp compiler. If you have anaconda environment and vscode: If an error arises "Error while installing python package: llama-cpp-python" then, try to install c++ as an extension in vscode and try to run the code OR Reinstall VS Code with c++ build tools and other necessary tools, here's a reference:

image

Just in case you don't have VS installer, you can find it with Download Build Tools from visualstudio.microsoft.com/visual-cpp-build-tools.

Then, use the following command: !pip install llama-cpp-python

Setup:

Additionally, create a separate folder named model and download the llm model (Quantized) from huggingface - sqlcoder Link - https://huggingface.co/TheBloke/sqlcoder2-GGUF/blob/main/sqlcoder2.Q4_K_M.gguf

Then change the path in "model_path" variable which is present inside the function.

Environment:

Create a new environment after anaconda installation - conda create -n <your_env_name> and also activate the environment - conda activate <your_env_name> then, Use the command:"pip install -r requirements" to install all necessary dependencies.

The commands are to be run in anaconda prompt after creating and activating the environment

About:

This is an Generative AI based Application which is deployed through Streamlit Framework, based on the prompt we define answers are seen accordingly. This is a "Prompt" based chatbot or Prompt Engineering based application utilised to convert a question in the form of query to a SQl (Structured Query Language) which is used to interact with the metabases and other databases. This is a local based application where we do not require any APIs or additional information to access or share our information thus putting a privacy of our personal information.

Why this selected model?

image

According to the above diagram, gpt-4 a closed Model requires API key and other details to access it whereas our selected model performance is about as good as the predecessor of GPT-4 and since it is open-sourced we can use it as a local model for any text generation related tasks.

text2sql_prompt's People

Contributors

mr-nobody15 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.