Skip to content

Fine-tuning a jumpstart model llama-3-2-1b fails.

0

I am using a csv from my s3 bucket to fine tune llama-3.2-1B instruct model. It never succeeds. This is the error I get. Error Image

My csv isn't very complex either my CSV

Any idea what am I doing wrong? I am quite new to this.

1 Answer
-1

I apologize for the inconvenience you're experiencing with fine-tuning the Llama 3.2 1B model using Amazon SageMaker JumpStart. Based on the error message and the CSV file you've shared, I can provide some insights and suggestions to help resolve the issue.

The error message indicates that there's a problem with the input data format. Specifically, it mentions "ValueError: Expected input to be a string, got float". This suggests that the model is expecting text input, but it's receiving numerical values instead.

Looking at your CSV file, I notice that the first column contains numerical values (0, 1, 2, etc.). For fine-tuning text generation models like Llama 3.2, the input data should typically be in a specific format. The CSV file should contain two columns: one for the input text and one for the target text.

Here are some steps you can take to address this issue:

  1. Reformat your CSV file: Ensure that your CSV file has two columns. The first column should contain the input text (prompts or questions), and the second column should contain the corresponding output text (responses or completions).

  2. Remove numerical labels: If the numbers in the first column are meant to be labels or identifiers, consider removing them or moving them to a separate file. The fine-tuning process doesn't require numerical labels.

  3. Check data types: Make sure all entries in both columns are strings (text), not numbers or other data types.

  4. Use the correct dataset format: When setting up the fine-tuning job, make sure you're using the appropriate dataset format. For instruction tuning, you should set the hyperparameter "instruction_tuned" to "True".

  5. Verify S3 bucket location: Ensure that your S3 bucket containing the training data is in the same AWS region as your SageMaker instance.

Here's an example of how your code might look when setting up the fine-tuning job:

estimator = JumpStartEstimator(
    model_id="meta-textgeneration-llama-3-2-1b",
    environment={"accept_eula": "true"}
)

estimator.set_hyperparameters(
    instruction_tuned="True",
    epoch="5",
    max_input_length="1024"
)

estimator.fit({"training": "s3://your-bucket-name/path/to/your/data.csv"})

Make sure to replace "your-bucket-name/path/to/your/data.csv" with the actual S3 path to your CSV file.

If you continue to experience issues after making these changes, you may want to review the SageMaker JumpStart documentation for any specific requirements for the Llama 3.2 1B model, or consider reaching out to AWS support for further assistance.
Sources
Fine-tune Meta Llama 3.2 text generation models for generative AI inference using Amazon SageMaker JumpStart | AWS Machine Learning Blog
Fine-tune Llama 3 for text generation on Amazon SageMaker JumpStart | AWS Machine Learning Blog

answered 2 years ago

  • It says list index out of rang not Expected input to be a string, got float. AI needs to get smarter :P

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.