- Newest
- Most votes
- Most comments
The error you're encountering is likely due to formatting issues in your JSONL file. Looking at the example you provided, there are a few problems:
-
The file appears to contain comments (the line starting with
//), which are not valid in JSONL format. -
There's a syntax error in your JSON objects - in both examples, you're missing a quotation mark before "role" in the assistant's response. It should be
{"role": "assistant"...instead of{role": "assistant".... -
JSONL requires each JSON object to be on a single line with no additional new lines or empty lines.
For fine-tuning models in Amazon Bedrock, each line must be a valid JSON object. Make sure:
- Remove any comments or header lines
- Fix the missing quotation marks
- Ensure each JSON object is complete and properly formatted
- Verify there are no additional new lines between records
The JSONL file should look like this (with each JSON object on a single line):
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "You are a digital assistant with a friendly personality"}], "messages": [{"role": "user", "content": [{"text": "What is the first step I must take before proceeding to change any information?"}]}, {"role": "assistant", "content": [{"text": "You must coordinate with all those who need access."}]}]}
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "You are a digital assistant with a friendly personality"}], "messages": [{"role": "user", "content": [{"text": "Before I dive into tweaking details, what is the first step I need to take?"}]}, {"role": "assistant", "content": [{"text": "You must coordinate with all those who need access."}]}]}
Even if online JSONL validators accept your file, Amazon Bedrock has specific formatting requirements for fine-tuning jobs.
Sources
Troubleshooting model customization issues - Amazon Bedrock
Prepare your training datasets for fine-tuning and continued pre-training - Amazon Bedrock
Relevant content
asked 2 years ago
asked 9 months ago
asked 3 years ago
