Closed nidhinpd-YML closed 2 months ago
@nidhinpd-YML
There might be some formatting issues with the CSV file you provided. I tried both of the code snippets you shared, passing a string file path and using a pathlib.Path
object, and both worked.
You can also use a URL for a CSV file. Try the code below and let me know if you’re still facing any issues.
import random
name = f'generate-num-{random.randint(0,10000)}'
operation = genai.create_tuned_model(
# You can use a tuned model here too. Set `source_model="tunedModels/..."`
source_model=base_model.name,
# Put csv file path"
training_data='https://docs.google.com/spreadsheets/d/1Sixq4JkYGCp1tJu0KukI6lLIZZ3kivvIq-pHcSiq6QA/edit?usp=sharing',
id = name,
epoch_count = 100,
batch_size=4,
learning_rate=0.001,
)
@Gunand3043 Thanks. It was the CSV formatting issue.
Description of the bug:
As mentioned in the docs, I tried uploading CSV (as a str file path and pathlib.Path object) as training data to my tuned model. I tried with JSON and it works fine. But when I tried with CSV it shows error.
Code tried as str file path
Code tried as pathlib.Path object
CSV file
Error stack
I noticed that during the last step of CSV processing in
encode_tuning_example
the CSV data goes into the dict section and raiseskey_error
.Actual vs expected behavior:
Actual
Expected
Any other information you'd like to share?
No response