Azure OpenAI service - How can we train the GPT model to be aware of a custom database Schema

Neeraj Shrivastava 141 Reputation points
2024-02-15T21:54:46.4233333+00:00

Hi, I am working on building a GenAI solution that will allow users to get a SQL generated based on a prompt they provide, I want the generated SQL to use my own custom database schema and its own tables and columns, How can I train \ fine tune the model to be aware of the custom database schema. Please note I am using AzureOpen AI service and not looking forward to a separate python and langchain based solution at this stage. I want to know if this is possible through azure portal - OpenAI service I found the below document that explains pre-training the model for specific prompts, Azure OpenAI Service fine-tuning gpt-3.5-turbo - Azure OpenAI | Microsoft Learn However my requirement is to inform model about my own custom schema with some 50+ tables and 5000 columns, I can not follow the process mentioned in this document. Please advise. Thanks, Neeraj.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,098 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,629 questions
{count} votes

Accepted answer
  1. Maui Rivera 240 Reputation points Microsoft Employee
    2024-02-16T06:29:15.9533333+00:00

    This is possible by leveraging the "On Your Data" containing your database schema and function_calling features. I'm working on a similar use case last week. I'll clean up the Notebook file and share my solution here.


1 additional answer

Sort by: Most helpful
  1. HUNG Tran 101 Reputation points
    2024-02-16T00:52:32.9066667+00:00

    Hi Neeraj Shrivastava

    Take care of the Prerequisites section of the Azure OpenAI GPT 3.5 Turbo fine-tuning tutorial and make sure you have prepared correctly. Specifically, note the model, service version, and resource region:

    gpt-35-turbo-0613 - fine-tuning of this model is limited to a subset of regions, and is not available in every region the base model is available.

    • Check if your resource region information is North Central US or Sweden Central
    • Check your deployment is GPT 3.5 Turbo version 0613?

    Screenshot that shows how to configure an Azure OpenAI resource in the Azure portal.

    You can read more details below.

    Fine-tuning models

    Hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.