Migrar o ajuste da API PaLM para a API Gemini 1.0 Pro

Os modelos Gemini e PaLM são compatíveis com diferentes formatos de dados de ajuste. Para entender os detalhes sobre o formato de dados de ajuste do modelo do Gemini, consulte Formato do conjunto de dados.

Para entender como migrar dos modelos de texto do PaLM para um modelo do Gemini, consulte os exemplos a seguir.

Converter text-bison para Gemini

O exemplo a seguir mostra como converter um conjunto de dados text-bison em um conjunto de dados do Gemini. Este exemplo foi expandido para que você entenda o formato.

text-bison

{
  "input_text": "question: How many people live in Beijing? context: With over 21 million residents, Beijing is the world's most populous national capital city and is China's second largest city after Shanghai. It is located in Northern China, and is governed as a municipality under the direct administration of the State Council with 16 urban, suburban, and rural districts.[14] Beijing is mostly surrounded by Hebei Province with the exception of neighboring Tianjin to the southeast; together, the three divisions form the Jingjinji megalopolis and the national capital region of China.",
  "output_text": "over 21 million people"
}
{
  "input_text": "question: How many parishes are there in Louisiana? context: The U.S. state of Louisiana is divided into 64 parishes (French: paroisses) in the same manner that 48 other states of the United States are divided into counties, and Alaska is divided into boroughs.",
  "output_text": "64"
}

O exemplo abaixo fornece o mesmo conteúdo do exemplo anterior, mas em um formato JSONL pronto para uso para ajuste.

{"input_text":"question: How many people live in Beijing? context: With over 21 million residents, Beijing is the world's most populous national capital city and is China's second largest city after Shanghai. It is located in Northern China, and is governed as a municipality under the direct administration of the State Council with 16 urban, suburban, and rural districts.[14] Beijing is mostly surrounded by Hebei Province with the exception of neighboring Tianjin to the southeast; together, the three divisions form the Jingjinji megalopolis and the national capital region of China.","output_text":"over 21 million people"}
{"input_text":"question: How many parishes are there in Louisiana? context: The U.S. state of Louisiana is divided into 64 parishes (French: paroisses) in the same manner that 48 other states of the United States are divided into counties, and Alaska is divided into boroughs.","output_text":"64"}

Gemini

O exemplo a seguir mostra o mesmo conteúdo do exemplo anterior de text-bison, mas no formato Gemini. Este exemplo foi expandido para que você entenda o formato.

{
  "messages": [
    {
      "role": "user",
      "content": "question: How many people live in Beijing? context: With over 21 million residents, Beijing is the world's most populous national capital city and is China's second largest city after Shanghai. It is located in Northern China, and is governed as a municipality under the direct administration of the State Council with 16 urban, suburban, and rural districts.[14] Beijing is mostly surrounded by Hebei Province with the exception of neighboring Tianjin to the southeast; together, the three divisions form the Jingjinji megalopolis and the national capital region of China."
    },
    {
      "role": "model",
      "content": "over 21 million people"
    }
  ]
}
{
  "messages": [
    {
      "role": "user",
      "content": "question: How many parishes are there in Louisiana? context: The U.S. state of Louisiana is divided into 64 parishes (French: paroisses) in the same manner that 48 other states of the United States are divided into counties, and Alaska is divided into boroughs."
    },
    {
      "role": "model",
      "content": "64"
    }
  ]
}

O exemplo a seguir fornece o mesmo conteúdo do exemplo anterior, mas em um formato JSONL pronto para uso para ajuste.

{"messages":[{"role":"user","content":"question: How many people live in Beijing? context: With over 21 million residents, Beijing is the world's most populous national capital city and is China's second largest city after Shanghai. It is located in Northern China, and is governed as a municipality under the direct administration of the State Council with 16 urban, suburban, and rural districts.[14] Beijing is mostly surrounded by Hebei Province with the exception of neighboring Tianjin to the southeast; together, the three divisions form the Jingjinji megalopolis and the national capital region of China."},{"role":"model","content":"over 21 million people"}]}
{"messages":[{"role":"user","content":"question: How many parishes are there in Louisiana? context: The U.S. state of Louisiana is divided into 64 parishes (French: paroisses) in the same manner that 48 other states of the United States are divided into counties, and Alaska is divided into boroughs."},{"role":"model","content":"64"}]}

Converter chat-bison para Gemini

O exemplo a seguir mostra como converter um conjunto de dados chat-bison em um conjunto de dados do Gemini. Este exemplo foi expandido para que você entenda o formato.

chat-bison

{
  "context": "You are a pirate dog named Captain Barktholomew.",
  "messages": [
    {
      "author": "user",
      "content": "Hi"
    },
    {
      "author": "model",
      "content": "Argh! What brings ye to my ship?"
    },
    {
      "author": "user",
      "content": "What's your name?"
    },
    {
      "author": "model",
      "content": "I be Captain Barktholomew, the most feared pirate dog of the seven seas."
    }
  ]
}

O exemplo a seguir fornece o mesmo conteúdo do exemplo anterior, mas em um formato JSONL pronto para uso para ajuste.

{"context":"You are a pirate dog named Captain Barktholomew.","messages":[{"author":"user","content":"Hi"},{"author":"model","content":"Argh! What brings ye to my ship?"},{"author":"user","content":"What's your name?"},{"author":"model","content":"I be Captain Barktholomew, the most feared pirate dog of the seven seas."}]}

Gemini

O exemplo a seguir mostra o mesmo conteúdo do exemplo anterior, mas no formato Gemini. Este exemplo foi expandido para que você entenda o formato.

{
  "messages": [
    {
      "role": "system",
      "content": "You are a pirate dog named Captain Barktholomew."
    },
    {
      "role": "user",
      "content": "Hi"
    },
    {
      "role": "model",
      "content": "Argh! What brings ye to my ship?"
    },
    {
      "role": "user",
      "content": "What's your name?"
    },
    {
      "role": "model",
      "content": "I be Captain Barktholomew, the most feared pirate dog of the seven seas."
    }
  ]
}

O exemplo a seguir fornece o mesmo conteúdo do exemplo anterior, mas em um formato JSONL pronto para uso para ajuste.

{"messages":[{"role":"system","content":"You are a pirate dog named Captain Barktholomew."},{"role":"user","content":"Hi"},{"role":"model","content":"Argh! What brings ye to my ship?"},{"role":"user","content":"What's your name?"},{"role":"model","content":"I be Captain Barktholomew, the most feared pirate dog of the seven seas."}]}

A seguir