Search code examples
pythonopenai-apigpt-3

Openai: `prompt` column/key is missing. Please make sure you name your columns/keys appropriately, then retry


I want to run GPT-3 for text classification. As the first step, I prepare data using openai CLI. I got a csv file which looks like as follow:

enter image description here

I wrote following command for preparing the data:

openai tools fine_tunes.prepare_data -f "Path\\training_dataset.csv"

However, I got following error:

enter image description here

I am not sure about "name columns/keys appropriately". Is there any convention that I should follow? Any help would be really appreciated to fix the error


Solution

  • You may convert your csv/tsv file to json, rename the header as prompt and completion.

    Like this: | prompt | completion | | -------- | -------------- | | text1 | result1 | | text2 | result2 |