CSV to fine-tune a ChatGPT model

Hi,

I’m stuck with this.

I have a CSV file with three “columns”: system, user, assistant.

I want to convert this file into a JSONL file that is the only format accepted by OpenAI for fine-tuning a model.

I’m completely stuck on getting it into the right format without any code.

I get to this (a JSON string).

But the JSONL format does not start end with brackets
And each object should be in a new line.

Could you help?

What OpenAI module are you using? If it requires a specific format for input you should be able to select the data structure in JSON Aggregator. It becomes available for selection once you add the OpenAI module AFTER the JSON Aggregator.

If that’s not an option, you’ll need to determine the exact format OpenAI module needs the JSON to be in. Sorry I am not that familiar with the OpenAI modules just yet.

2 Likes

Thanks Donald!

Yeah, After those steps I was trying to create a file from text on Google Drive adding .jsonl extension but it kept adding .txt to it and I think that’s where it messed it up. (to then upload this file into the OpenAI API.

I went with text parsers to format the data correctly into JSONL format and directly feed this data into the OpenAI API to fix it up.

3 Likes

Hello there @Beatriz_Estrella welcome to the community :wave:

I just want to quickly say congrats on getting this up and running :clap:

Also, thank you for stepping back in here and sharing what did the trick for you. This is super valuable and can be incredibly helpful to others searching for similar information in the future. :pray:

2 Likes

Hello ! Thanks for your feedback. That’s a really interesting use case and i’m currently working at the same project. But one question, How did you manage to write the same NAME (role and content) into the same collection. I’ve spent my whole morning trying to figure it out this issue but impossible to understand how to do this as data structure does not allow to get the same name twice.

Thanks for your help !

Hey there @Vivien_Chantrel :wave:

just wanted to offer a piece of friendly advice here. It is generally better to start a new topic for each new question in the community. Now, I understand that you might be referring to some info in this thread, but you can always link this post to the new question.

By following this procedure you are more likely to get help from someone here in our forum. It also keeps the community neat and tidy. :pray:

Thank you so much!

2 Likes

Hi Vivien!

If you open a new thread you can let me know and I’ll try to help you.

I don’t understand your question 100% so if you can share screenshots or something similar I’ll try to assist you!

3 Likes

Hi ! Thanks both for your answer.

Indeed, I have created a new thread. Here is my case and my question about the topic.
I have a done few steps and learned a lot of things since btw. Here is where I am and where i’m stuck.

Have a good day !

2 Likes