Which Azure OpenAI model to use for custom data

Roberto Guardamagna 0 Reputation points
2024-03-21T15:34:08.33+00:00

Hi,

I'm new with Azure OpenAI and I'm trying to understand how to "train" the AI with a dataset composed by my own data.
To be specific...I would like to integrate the "AI" to an existing program where the user has to compile a form.
Instead of compiling a form by typing information with the keyboard, I would like the user to dictate those info using a microphone.
For this part I'm using Microsoft Cognitive Service for voice recognition (and it's working good), every form's field has its specific name and all the available form's fields are contained into a DB table (SQL).
Let's assume that the form has 3 fields: brand, color, size.
The user could tell "the brand is brand1, the color is red and the size is 100 cm", the "AI" should reply with a JSON structure like this:

{
  "brand": "brand1",
  "color": "red",
  "size": 100
}

the user could also tell color, then brand and then size or other different combination.
I tried to create a custom model with Azure OpenAI Studio but It shows just 3 base models: ada(1), babbage(1), curie(1).
I selected "ada", sent the JSONL file as follows with only the "brand" field (just to test):

{"prompt": "brand", "completion": "brand"}
{"prompt": "brand is", "completion": "brand"}
{"prompt": "the brand is", "completion": "brand"}
{"prompt": "brand name is", "completion": "brand"}

If I'm correct, the JSONL for training should contain all the possible values of the user prompt with the correct answer.
After processing the file with success, I deployed it and made a test with a C# test program.
I'm using "Betalgo OpenAI" nuget package, I can get a response from the AI for a "generic" question (using "ChatCompletion") if I use a standard model (gpt-35-turbo).
If I try to request, for example, "generate a json where brand name is brand1" using my custom model, an error appears reporting that the selected model is not correct for "ChatCompletion".
Where is my mistake?
Thank you, regards.

Roberto

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,112 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Charlie Wei 1,895 Reputation points
    2024-03-21T16:33:46.1033333+00:00

    Hello Roberto Guardamagna,

    Although I haven't directly answered your question, I believe the "function calling" feature of Azure OpenAI Assistants might be more suitable for your situation. You could allow GPT to decide whether to call your existing program to compile a form. Below is just a quick example, but I recommend you first read this document.

    curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants?api-version=2024-02-15-preview \
      -H "api-key: $AZURE_OPENAI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "instructions": "You are an assistant for helping users compile a form."
        "tools": [{
          "type": "function",
          "function": {
            "name": "compilingForm",
            "description": "Compiling a Form by a User",
            "parameters": {
              "type": "object",
              "properties": {
                "brand": {"type": "string", "description":"..."},
                "color": {"type": "string", "description":"..."},
                "size": {"type": "string", "description":"..."},
              },
              "required": []
            }
          }	
        }],
        "model": "your-custom-model-deployment-name"
      }'
    
    

    Best regards,
    Charlie


    If you find my response helpful, please consider accepting this answer and voting 'yes' to support the community. Thank you!