Funkcja dostrajania interfejsu Gemini API zapewnia mechanizm selekcjonowania danych wyjściowych, gdy masz mały zbiór przykładowych danych wejściowych i wyjściowych. Więcej informacji znajdziesz w przewodniku po dostrajaniu modelu i samouczku.
Metoda: dotModels.create
- Punkt końcowy
- Parametry zapytania
- Treść żądania
- Treść odpowiedzi
- Zakresy autoryzacji
- Przykładowe żądanie
Tworzy model dostrojony. Sprawdź postęp dostrajania pośredniego (jeśli dotyczy) w usłudze google.longrunning.Operations
.
Dostęp do stanu i wyników za pomocą usługi Operations. Przykład: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222
Punkt końcowy
post
https://generativelanguage.googleapis.com/v1beta/tunedModels
Parametry zapytania
tunedModelId
string
Opcjonalnie: Unikalny identyfikator dostrojonego modelu, jeśli został określony. Ta wartość może mieć maksymalnie 40 znaków. Pierwszym znakiem musi być litera, a ostatnim może być litera lub cyfra. Identyfikator musi być zgodny z wyrażeniem regularnym: [a-z]([a-z0-9-]{0,38}[a-z0-9])?
.
Treść żądania
Treść żądania zawiera wystąpienie elementu TunedModel
.
displayName
string
Opcjonalnie: Nazwa wyświetlana dla tego modelu w interfejsach. Wyświetlana nazwa może mieć maksymalnie 40 znaków łącznie ze spacjami.
description
string
Opcjonalnie: Krótki opis tego modelu.
tuningTask
object (TuningTask
)
Wymagane. Zadanie dostrajania, które tworzy model dostrojony.
source_model
. Model używany jako punkt początkowy do dostrajania. source_model
może mieć tylko jedną z tych wartości:
tunedModelSource
object (TunedModelSource
)
Opcjonalnie: DostrojonyModel, który będzie używany jako punkt początkowy do trenowania nowego modelu.
baseModel
string
Stały. Nazwa urządzenia Model
do dostrojenia. Przykład: models/gemini-1.5-flash-001
temperature
number
Opcjonalnie: Określa losowość wyników.
Wartości mogą się mieścić w przedziale powyżej [0.0,1.0]
. Wartość bliższa 1.0
daje bardziej zróżnicowane odpowiedzi, a wartość bliższa 0.0
daje zwykle mniej zaskakujących odpowiedzi z modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topP
number
Opcjonalnie: Do próbkowania Nucleus.
Próbkowanie nucleusa uwzględnia najmniejszy zestaw tokenów, którego suma prawdopodobieństwa wynosi co najmniej topP
.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topK
integer
Opcjonalnie: Próbkowanie Top-K.
Próbkowanie Top-K uwzględnia zestaw topK
najbardziej prawdopodobnych tokenów. Ta wartość określa, która domyślnie ma być używana przez backend przy wywoływaniu modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
Przykładowe żądanie
Python
Treść odpowiedzi
Ten zasób reprezentuje długotrwałą operację, która jest wynikiem wywołania sieciowego interfejsu API.
W przypadku powodzenia treść żądania zawiera dane o następującej strukturze:
name
string
Nazwa przypisana przez serwer, która jest unikalna tylko w obrębie tej samej usługi, która pierwotnie została zwrócona. Jeśli używasz domyślnego mapowania HTTP, pole name
powinno być nazwą zasobu kończącą się na operations/{unique_id}
.
metadata
object
Metadane specyficzne dla usługi powiązane z operacją. Zwykle zawiera on informacje o postępach i typowe metadane, takie jak czas utworzenia. Niektóre usługi mogą nie udostępniać takich metadanych. Każda metoda zwracająca długotrwałą operację powinna udokumentować typ metadanych, jeśli taki istnieje.
Obiekt zawierający pola dowolnego typu. Dodatkowe pole "@type"
zawiera identyfikator URI identyfikujący typ. Przykład: { "id": 1234, "@type": "types.example.com/standard/id" }
.
done
boolean
Jeśli wartość to false
, oznacza to, że operacja jest nadal w toku. Jeśli true
, operacja jest ukończona i dostępna jest wartość error
lub response
.
result
. Wynik operacji, którym może być error
lub prawidłowy response
. Jeśli done
== false
, nie ustawiono error
ani response
. Jeśli done
== true
, można ustawić dokładnie jedną z tych wartości error
lub response
. Niektóre usługi mogą nie dawać oczekiwanych rezultatów. result
może mieć tylko jedną z tych wartości:
error
object (Status
)
Wynik błędu operacji w przypadku niepowodzenia lub anulowania.
response
object
Normalna, udana odpowiedź operacji. Jeśli pierwotna metoda nie zwróci żadnych danych o powodzeniu, np. Delete
, odpowiedź będzie miała postać google.protobuf.Empty
. Jeśli pierwotna metoda to standardowa metoda Get
/Create
/Update
, odpowiedzią powinna być zasób. W przypadku innych metod odpowiedź powinna mieć typ XxxResponse
, gdzie Xxx
to pierwotna nazwa metody. Jeśli na przykład pierwotna nazwa metody to TakeSnapshot()
, typ odpowiedzi to TakeSnapshotResponse
.
Obiekt zawierający pola dowolnego typu. Dodatkowe pole "@type"
zawiera identyfikator URI identyfikujący typ. Przykład: { "id": 1234, "@type": "types.example.com/standard/id" }
.
Zapis JSON |
---|
{ "name": string, "metadata": { "@type": string, field1: ..., ... }, "done": boolean, // Union field |
Metoda: tunelModels.generateContent
Generuje odpowiedź modelu na podstawie danych wejściowych GenerateContentRequest
. Szczegółowe informacje o używaniu tej funkcji znajdziesz w przewodniku po generowaniu tekstu. Możliwości wprowadzania różnią się w zależności od modelu, w tym na modelach dostrojonych. Szczegółowe informacje można znaleźć w przewodniku po modelu i w przewodniku dostrajania.
Punkt końcowy
post
https://generativelanguage.googleapis.com/v1beta/{model=tunedModels/*}:generateContent
Parametry ścieżki
model
string
Wymagane. Nazwa obiektu Model
, która ma być używana do generowania uzupełniania.
Format: name=models/{model}
. Ma on postać tunedModels/{tunedmodel}
.
Treść żądania
Treść żądania zawiera dane o następującej strukturze:
contents[]
object (Content
)
Wymagane. Treść bieżącej rozmowy z modelem.
W przypadku zapytań jednoetapowych jest to pojedyncza instancja. W przypadku zapytań wieloetapowych, takich jak czat, jest to pole powtarzane, które zawiera historię rozmowy i ostatnie żądanie.
tools[]
object (Tool
)
Opcjonalnie: Lista właściwości Tools
, których Model
może użyć do wygenerowania następnej odpowiedzi.
Tool
to fragment kodu, który umożliwia systemowi wchodzenie w interakcję z zewnętrznymi systemami w celu wykonania działania lub zestawu działań poza zakresem wiedzy i zakresu Model
. Obsługiwane elementy typu Tool
to Function
i codeExecution
. Więcej informacji znajdziesz w przewodnikach dotyczących wywoływania funkcji i wykonania kodu.
toolConfig
object (ToolConfig
)
Opcjonalnie: Konfiguracja narzędzia dla dowolnych Tool
określonych w żądaniu. Przykład użycia znajdziesz w przewodniku dotyczącym wywoływania funkcji.
safetySettings[]
object (SafetySetting
)
Opcjonalnie: Lista unikalnych instancji SafetySetting
do blokowania niebezpiecznych treści.
Ta zmiana zostanie zastosowana w GenerateContentRequest.contents
i GenerateContentResponse.candidates
. Każdy typ SafetyCategory
powinien mieć maksymalnie 1 ustawienie. Interfejs API zablokuje treści i odpowiedzi, które nie osiągną progów ustawionych przez te ustawienia. Ta lista zastępuje domyślne ustawienia dla każdego elementu SafetyCategory
określonego w ustawieniach bezpieczeństwa. Jeśli na liście nie ma atrybutu SafetySetting
dla danego elementu SafetyCategory
, interfejs API użyje dla tej kategorii domyślnego ustawienia bezpieczeństwa. Kategorie szkodliwego działania: HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT są obsługiwane. Szczegółowe informacje o dostępnych ustawieniach bezpieczeństwa znajdziesz w przewodniku. Aby dowiedzieć się, jak uwzględniać kwestie bezpieczeństwa w aplikacjach AI, zapoznaj się ze wskazówkami dotyczącymi bezpieczeństwa.
systemInstruction
object (Content
)
Opcjonalnie: Programista skonfigurował instrukcje systemowe. Obecnie tylko tekstowe.
generationConfig
object (GenerationConfig
)
Opcjonalnie: Opcje konfiguracji generowania modeli i ich danych wyjściowych.
cachedContent
string
Opcjonalnie: Nazwa treści zapisana w pamięci podręcznej, która może służyć jako kontekst do wyświetlania podpowiedzi. Format: cachedContents/{cachedContent}
Przykładowe żądanie
Tekst
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Obraz
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Dźwięk
Python
Node.js
Pudrowy róż
Wideo
Python
Node.js
Przeczytaj
Pudrowy róż
Python
Pudrowy róż
Czat
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Cache (Pamięć podręczna)
Python
Node.js
Dostrojony model
Python
Tryb JSON
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Wykonanie kodu
Python
Kotlin
Java
Wywołanie funkcji
Python
Node.js
Pudrowy róż
Kotlin
Swift
Dart
Java
Konfiguracja generowania
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Ustawienia bezpieczeństwa
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Instrukcja systemowa
Python
Node.js
Przeczytaj
Pudrowy róż
Kotlin
Swift
Dart
Java
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu GenerateContentResponse
.
Metoda: tuneModels.get
Pobiera informacje o konkretnym TunedModel.
Punkt końcowy
pobierz
https://generativelanguage.googleapis.com/v1beta/{name=tunedModels/*}
Parametry ścieżki
name
string
Wymagane. Nazwa zasobu modelu.
Format: tunedModels/my-model-id
Przyjmuje postać tunedModels/{tunedmodel}
.
Treść żądania
Treść żądania musi być pusta.
Przykładowe żądanie
Python
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu TunedModel
.
Metoda: dostrojonyModels.list
- Punkt końcowy
- Parametry zapytania
- Treść żądania
- Treść odpowiedzi
- Zakresy autoryzacji
- Przykładowe żądanie
Listy utworzone z dostrojonych modeli.
Punkt końcowy
pobierz
https://generativelanguage.googleapis.com/v1beta/tunedModels
Parametry zapytania
pageSize
integer
Opcjonalnie: Maksymalna liczba elementów TunedModels
do zwrócenia (na stronę). Usługa może zwrócić mniej dostrojonych modeli.
Jeśli nie określono inaczej, zwróconych zostanie maksymalnie 10 dostrojonych modeli. Ta metoda zwraca maksymalnie 1000 modeli na stronę, nawet jeśli przekażesz większy rozmiar strony.
pageToken
string
Opcjonalnie: Token strony otrzymany z poprzedniego wywołania funkcji tunedModels.list
.
Podaj pageToken
zwrócony przez jedno żądanie jako argument następnego żądania, aby pobrać kolejną stronę.
Podczas dzielenia na strony wszystkie pozostałe parametry podane w narzędziu tunedModels.list
muszą być zgodne z wywołaniem, które dostarczyło token strony.
filter
string
Opcjonalnie: Filtr to wyszukiwanie całego tekstu w opisie i wyświetlaną nazwie dostrojonego modelu. Domyślnie wyniki nie obejmują dostrojonych modeli udostępnionych wszystkim.
Dodatkowe operatory: - owner:me - writers:me - developers:me - developers:everyone
Przykłady: „owner:me” zwraca wszystkie dostrojone modele, w przypadku których element wywołujący ma rolę właściciela „readers:me” zwraca wszystkie dostrojone modele, w przypadku których element wywołujący ma rolę odczytu „readers:everyone” zwraca wszystkie dostrojone modele, które zostały udostępnione wszystkim
Treść żądania
Treść żądania musi być pusta.
Przykładowe żądanie
Python
Treść odpowiedzi
Odpowiedź z modelu tunedModels.list
zawierająca podzieloną na strony listę modeli.
W przypadku powodzenia treść żądania zawiera dane o następującej strukturze:
tunedModels[]
object (TunedModel
)
Zwrócone modele.
nextPageToken
string
Token, który może zostać wysłany jako pageToken
w celu pobrania następnej strony.
Jeśli pominiesz to pole, nie będzie więcej stron.
Zapis JSON |
---|
{
"tunedModels": [
{
object ( |
Metoda: tunelModels.patch
Aktualizuje model dostrojony.
Punkt końcowy
poprawka
https://generativelanguage.googleapis.com/v1beta/{tunedModel.name=tunedModels/*}
PATCH https://generativelanguage.googleapis.com/v1beta/{tunedModel.name=tunedModels/*}
Parametry ścieżki
tunedModel.name
string
Tylko dane wyjściowe. Nazwa dostrojonego modelu. Podczas tworzenia zostanie wygenerowana unikalna nazwa. Przykład: tunedModels/az2mb0bpw6i
jeśli parametr displayName jest ustawiony podczas tworzenia, to część identyfikatora nazwy zostanie ustawiona przez połączenie wyrazów w displayName za pomocą łączników i dodanie części losowej, aby zapewnić unikalność.
Przykład:
- displayName =
Sentence Translator
- nazwa =
tunedModels/sentence-translator-u3b7m
Przyjmuje postaćtunedModels/{tunedmodel}
.
Parametry zapytania
updateMask
string (FieldMask
format)
Wymagane. Lista pól do zaktualizowania.
Jest to rozdzielana przecinkami lista w pełni kwalifikowanych nazw pól. Przykład: "user.displayName,photo"
.
Treść żądania
Treść żądania zawiera wystąpienie elementu TunedModel
.
displayName
string
Opcjonalnie: Nazwa wyświetlana dla tego modelu w interfejsach. Wyświetlana nazwa może mieć maksymalnie 40 znaków łącznie ze spacjami.
description
string
Opcjonalnie: Krótki opis tego modelu.
tuningTask
object (TuningTask
)
Wymagane. Zadanie dostrajania, które tworzy model dostrojony.
source_model
. Model używany jako punkt początkowy do dostrajania. source_model
może mieć tylko jedną z tych wartości:
tunedModelSource
object (TunedModelSource
)
Opcjonalnie: DostrojonyModel, który będzie używany jako punkt początkowy do trenowania nowego modelu.
temperature
number
Opcjonalnie: Określa losowość wyników.
Wartości mogą się mieścić w przedziale powyżej [0.0,1.0]
. Wartość bliższa 1.0
daje bardziej zróżnicowane odpowiedzi, a wartość bliższa 0.0
daje zwykle mniej zaskakujących odpowiedzi z modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topP
number
Opcjonalnie: Do próbkowania Nucleus.
Próbkowanie nucleusa uwzględnia najmniejszy zestaw tokenów, którego suma prawdopodobieństwa wynosi co najmniej topP
.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topK
integer
Opcjonalnie: Próbkowanie Top-K.
Próbkowanie Top-K uwzględnia zestaw topK
najbardziej prawdopodobnych tokenów. Ta wartość określa, która domyślnie ma być używana przez backend przy wywoływaniu modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu TunedModel
.
Metoda: tuneModels.delete
Usuwa dostrojony model.
Punkt końcowy
usuń
https://generativelanguage.googleapis.com/v1beta/{name=tunedModels/*}
Parametry ścieżki
name
string
Wymagane. Nazwa zasobu modelu. Format: tunedModels/my-model-id
Przyjmuje postać tunedModels/{tunedmodel}
.
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
Jeśli operacja się uda, treść odpowiedzi będzie pusta.
Zasób REST: dostrojonyModels
- Zasób: TunedModel
- TunedModelSource
- Stan
- TuningTask
- TuningSnapshot
- Zbiór danych
- TuningExamples
- TuningExample
- Hiperparametry
- Metody
Zasób: TunedModel
Dostrojony model utworzony za pomocą ModelService.CreateTunedModel.
name
string
Tylko dane wyjściowe. Nazwa dostrojonego modelu. Podczas tworzenia zostanie wygenerowana unikalna nazwa. Przykład: tunedModels/az2mb0bpw6i
jeśli parametr displayName jest ustawiony podczas tworzenia, to część identyfikatora nazwy zostanie ustawiona przez połączenie wyrazów w displayName za pomocą łączników i dodanie części losowej, aby zapewnić unikalność.
Przykład:
- displayName =
Sentence Translator
- nazwa =
tunedModels/sentence-translator-u3b7m
displayName
string
Opcjonalnie: Nazwa wyświetlana dla tego modelu w interfejsach. Wyświetlana nazwa może mieć maksymalnie 40 znaków łącznie ze spacjami.
description
string
Opcjonalnie: Krótki opis tego modelu.
state
enum (State
)
Tylko dane wyjściowe. Stan dostrojonego modelu.
createTime
string (Timestamp
format)
Tylko dane wyjściowe. Sygnatura czasowa utworzenia tego modelu.
Sygnatura czasowa w RFC3339 UTC „Zulu” z rozdzielczością nanosekundową i maksymalnie 9 cyframi po przecinku. Przykłady: "2014-10-02T15:01:23Z"
i "2014-10-02T15:01:23.045123456Z"
.
updateTime
string (Timestamp
format)
Tylko dane wyjściowe. Sygnatura czasowa aktualizacji tego modelu.
Sygnatura czasowa w RFC3339 UTC „Zulu” z rozdzielczością nanosekundową i maksymalnie 9 cyframi po przecinku. Przykłady: "2014-10-02T15:01:23Z"
i "2014-10-02T15:01:23.045123456Z"
.
tuningTask
object (TuningTask
)
Wymagane. Zadanie dostrajania, które tworzy model dostrojony.
source_model
. Model używany jako punkt początkowy do dostrajania. source_model
może mieć tylko jedną z tych wartości:
tunedModelSource
object (TunedModelSource
)
Opcjonalnie: DostrojonyModel, który będzie używany jako punkt początkowy do trenowania nowego modelu.
baseModel
string
Stały. Nazwa urządzenia Model
do dostrojenia. Przykład: models/gemini-1.5-flash-001
temperature
number
Opcjonalnie: Określa losowość wyników.
Wartości mogą się mieścić w przedziale powyżej [0.0,1.0]
. Wartość bliższa 1.0
daje bardziej zróżnicowane odpowiedzi, a wartość bliższa 0.0
daje zwykle mniej zaskakujących odpowiedzi z modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topP
number
Opcjonalnie: Do próbkowania Nucleus.
Próbkowanie nucleusa uwzględnia najmniejszy zestaw tokenów, którego suma prawdopodobieństwa wynosi co najmniej topP
.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
topK
integer
Opcjonalnie: Próbkowanie Top-K.
Próbkowanie Top-K uwzględnia zestaw topK
najbardziej prawdopodobnych tokenów. Ta wartość określa, która domyślnie ma być używana przez backend przy wywoływaniu modelu.
Ta wartość określa domyślną wartość, która będzie używana przez model podstawowy podczas jego tworzenia.
Zapis JSON |
---|
{ "name": string, "displayName": string, "description": string, "state": enum ( |
TunedModelSource
Dostrojony model jako źródło do trenowania nowego modelu.
tunedModel
string
Stały. Nazwa obiektu TunedModel
, która ma być używana jako punkt początkowy do trenowania nowego modelu. Przykład: tunedModels/my-tuned-model
baseModel
string
Tylko dane wyjściowe. Nazwa podstawowego urządzenia Model
, na podstawie którego dostrojono urządzenie TunedModel
. Przykład: models/gemini-1.5-flash-001
Zapis JSON |
---|
{ "tunedModel": string, "baseModel": string } |
Stan
Stan dostrojonego modelu.
Wartości w polu enum | |
---|---|
STATE_UNSPECIFIED |
Wartość domyślna. Ta wartość nie jest używana. |
CREATING |
Tworzę model. |
ACTIVE |
Model jest gotowy do użycia. |
FAILED |
Nie udało się utworzyć modelu. |
TuningTask
Dostrajanie zadań, które tworzą dostrojone modele.
startTime
string (Timestamp
format)
Tylko dane wyjściowe. Sygnatura czasowa rozpoczęcia dostrajania tego modelu.
Sygnatura czasowa w RFC3339 UTC „Zulu” z rozdzielczością nanosekundową i maksymalnie 9 cyframi po przecinku. Przykłady: "2014-10-02T15:01:23Z"
i "2014-10-02T15:01:23.045123456Z"
.
completeTime
string (Timestamp
format)
Tylko dane wyjściowe. Sygnatura czasowa ukończenia dostrajania tego modelu.
Sygnatura czasowa w RFC3339 UTC „Zulu” z rozdzielczością nanosekundową i maksymalnie 9 cyframi po przecinku. Przykłady: "2014-10-02T15:01:23Z"
i "2014-10-02T15:01:23.045123456Z"
.
snapshots[]
object (TuningSnapshot
)
Tylko dane wyjściowe. Wskaźniki zebrane podczas dostrajania.
trainingData
object (Dataset
)
Wymagane. Tylko dane wejściowe. Stały. Dane do trenowania modelu.
hyperparameters
object (Hyperparameters
)
Stały. Hiperparametry kontrolujące proces dostrajania. Jeśli nie zostanie podana, zostaną użyte wartości domyślne.
Zapis JSON |
---|
{ "startTime": string, "completeTime": string, "snapshots": [ { object ( |
TuningSnapshot
Nagrywaj dla pojedynczego kroku dostrajania.
step
integer
Tylko dane wyjściowe. Etap dostrajania.
epoch
integer
Tylko dane wyjściowe. Epoka, do której należał ten krok.
meanLoss
number
Tylko dane wyjściowe. Średnia utrata przykładów treningowych na tym etapie.
computeTime
string (Timestamp
format)
Tylko dane wyjściowe. Sygnatura czasowa obliczenia tego wskaźnika.
Sygnatura czasowa w RFC3339 UTC „Zulu” z rozdzielczością nanosekundową i maksymalnie 9 cyframi po przecinku. Przykłady: "2014-10-02T15:01:23Z"
i "2014-10-02T15:01:23.045123456Z"
.
Zapis JSON |
---|
{ "step": integer, "epoch": integer, "meanLoss": number, "computeTime": string } |
Zbiór danych
Zbiór danych do trenowania lub walidacji.
dataset
. Dane w treści lub odwołanie do danych. dataset
może mieć tylko jedną z tych wartości:
examples
object (TuningExamples
)
Opcjonalnie: Przykłady w tekście.
Zapis JSON |
---|
{ // Union field |
TuningExamples
Zbiór przykładów dostrajania. Mogą to być dane treningowe lub weryfikacyjne.
examples[]
object (TuningExample
)
Wymagane. Przykłady. Przykładowe dane wejściowe mogą dotyczyć tekstu lub dyskusji, ale wszystkie przykłady w zestawie muszą być tego samego typu.
Zapis JSON |
---|
{
"examples": [
{
object ( |
TuningExample
Jeden przykład dostrajania.
output
string
Wymagane. Oczekiwane dane wyjściowe modelu.
model_input
. Dane wejściowe dla modelu na potrzeby tego przykładu. model_input
może mieć tylko jedną z tych wartości:
textInput
string
Opcjonalnie: Dane wejściowe modelu tekstowego.
Zapis JSON |
---|
{ "output": string, // Union field |
Hiperparametry
Hiperparametry kontrolujące proces dostrajania. Więcej informacji znajdziesz na stronie https://ai.google.dev/docs/model_tuning_guidance
learning_rate_option
. Opcje określania tempa uczenia się podczas dostrajania. learning_rate_option
może mieć tylko jedną z tych wartości:
learningRate
number
Opcjonalnie: Stały. Hiperparametr tempa uczenia się na potrzeby dostrajania. Jeśli nie zostanie ustawiona, wartość domyślna 0,001 lub 0,0002 zostanie obliczona na podstawie liczby przykładów treningowych.
learningRateMultiplier
number
Opcjonalnie: Stały. Mnożnik tempa uczenia się jest używany do obliczania ostatecznego współczynnika uczenia się na podstawie wartości domyślnej (zalecanej). Rzeczywiste tempo uczenia się := learningRateMultiplier * domyślne tempo uczenia się Domyślne tempo uczenia się zależy od modelu podstawowego i rozmiaru zbioru danych. Jeśli nie jest skonfigurowana, używana jest wartość domyślna, czyli 1,0.
epochCount
integer
Stały. Liczba epok trenowania. Epoka to jedno przejście przez dane treningowe. Jeśli zasada nie jest skonfigurowana, używana jest wartość domyślna, czyli 5.
batchSize
integer
Stały. Hiperparametr rozmiaru wsadu na potrzeby dostrajania. Jeśli nie zostanie ustawiona, zostanie użyta domyślna wartość 4 lub 16 w zależności od liczby przykładów treningowych.
Zapis JSON |
---|
{ // Union field |