View a markdown version of this page

Formati di set di dati supportati per attività Bring-Your-Own-Dataset (BYOD) - Amazon SageMaker AI

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Formati di set di dati supportati per attività Bring-Your-Own-Dataset (BYOD)

I tipi Custom Scorer e di LLM-as-judge valutazione richiedono un file JSONL del set di dati personalizzato che si trova in S3. AWS È necessario fornire il file come file JSON Lines conforme a uno dei seguenti formati supportati. Gli esempi contenuti in questo documento sono stati ampliati per motivi di chiarezza.

Ogni formato ha le sue sfumature, ma come minimo tutti richiedono un prompt da parte dell'utente.

Campi obbligatori
Campo Richiesto
Richiesta dell'utente
Prompt di sistema No
Verità fondamentale Solo per Custom Scorer
Categoria No

1. Formato OpenAI

{ "messages": [ { "role": "system", # System prompt (looks for system role) "content": "You are a helpful assistant." }, { "role": "user", # Query (looks for user role) "content": "Hello!" }, { "role": "assistant", # Ground truth (looks for assistant role) "content": "Hello to you!" } ] }

2. SageMaker Valutazione

{ "system":"You are an English major with top marks in class who likes to give minimal word responses: ", "query":"What is the symbol that ends the sentence as a question", "response":"?", # Ground truth "category": "Grammar" }

3. HuggingFace Completamento rapido

Sono supportati sia i formati standard che quelli conversazionali.

# Standard { "prompt" : "What is the symbol that ends the sentence as a question", # Query "completion" : "?" # Ground truth } # Conversational { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What is the symbol that ends the sentence as a question" } ], "completion": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "?" } ] }

4. HuggingFace Preferenza

Support sia per il formato standard (stringa) che per il formato conversazionale (array di messaggi).

# Standard: {"prompt": "text", "chosen": "text", "rejected": "text"} { "prompt" : "The sky is", # Query "chosen" : "blue", # Ground truth "rejected" : "green" } # Conversational: { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What color is the sky?" } ], "chosen": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "It is blue." } ], "rejected": [ { "role": "assistant", "content": "It is green." } ] }

5. Formato Verl

Il formato Verl (sia i formati attuali che quelli precedenti) è supportato per i casi d'uso del reinforcement learning. Documenti Verl come riferimento: https://verl.readthedocs.io/en/latest/preparation/prepare_data.html

Gli utenti del formato VERL in genere non forniscono una risposta di base. Se vuoi comunque fornirne una, usa uno dei campi extra_info.answer oppurereward_model.ground_truth; ha la extra_info precedenza.

SageMaker conserva i seguenti campi specifici di Verl come metadati, se presenti:

  • id

  • data_source

  • ability

  • reward_model

  • extra_info

  • attributes

  • difficulty

# Newest VERL format where `prompt` is an array of messages. { "data_source": "openai/gsm8k", "prompt": [ { "content": "You are a helpful math tutor who explains solutions to questions step-by-step.", "role": "system" }, { "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "role": "user" } ], "ability": "math", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" }, "reward_model": { "ground_truth": "72" # Ignored in favor of extra_info.answer } } # Legacy VERL format where `prompt` is a string. Also supported. { "data_source": "openai/gsm8k", "prompt": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" } }