How to Customize or train my Azure OpenAI model.

frederick abila 20 Reputation points
2023-04-09T10:37:08.8666667+00:00

I have built an azure open ai resource and I am using the gpt-35-turbo model. I am integrating this into a react native app. I know that this is a pretrained model but I want to train it myself. In the playground I am given the option to enter some info which helps the ai understand who it is and answer queries as such. For example when I ask the ai about the name I don't expect it to reply that I am openai but rather reply as a name that I have set it as. I don't know if anyone understands but how do I implement this.

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

Accepted answer
  1. Sedat SALMAN 13,820 Reputation points
    2023-04-09T17:39:32.6433333+00:00

    It seems like you want to customize the behavior of the GPT-3.5-turbo model to make it respond with a specific name or follow certain instructions. While you can't directly train the model, you can use a technique called "prompt engineering" to guide the model's behavior. In the case of GPT-3.5-turbo, you can set an instruction in the prompt to define the AI's identity, and then ask your questions accordingly. Here's an example: null

    
    async function askJohn(question) {
      const prompt = `You are an AI language model called John, and your purpose is to assist users with their questions. ${question}`;
      const response = await openai.Completion.create({
        engine: 'gpt-3.5-turbo',
        prompt: prompt,
        max_tokens: 50, // Adjust the number of tokens based on your use case
        n: 1,
        stop: null,
        temperature: 0.8,
      });
    
      return response.choices[0].text.trim();
    }
    
    

    Use the askJohn function in your React Native app to ask questions and get answers:

    const question = 'What is the capital of France?';
    const answer = await askJohn(question);
    console.log(answer);
    
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.