Finetunes.create: No such File object

I’m trying to follow the fine tuning guide, OpenAI API and am able to produce a JSONL file by running the following command in Gitbash:

openai tools fine_tunes.prepare_data -f out.csv

The output of that command helpfully gives me another command, to “use that file when fine-tuning”:

openai api fine_tunes.create -t “out_prepared.jsonl” --no_packing --batch_size 0.25

However, that command fails, at first because --batch size is supposed to be an integer, but then because I get “openai.error.InvalidRequestError: No such File object: out_prepared.jsonl”. The error output also says something about "UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 1546: character maps to "

Since I was able to generate the JSONL file using the provided formatting tool, I don’t understand why the command it recommends I use next fails.

I think this is a duplicate of the question here:

I applied the fix, (although there is a typo, where it says to type args.file, instead of file) and my command is running now.

My command succeeded, but then seems to be having problems with file encoding when printing about the success to the console.

[2021-12-20 14:45:58] Fine-tune succeeded
Traceback (most recent call last):
File “C:\Users\mkessler\AppData\Roaming\Python\Python310\Scripts\openai”, line 72, in
File “C:\Users\mkessler\AppData\Roaming\Python\Python310\Scripts\openai”, line 61, in main
File “C:\Users\mkessler\AppData\Roaming\Python\Python310\site-packages\openai\”, line 364, in follow
File “C:\Users\mkessler\AppData\Roaming\Python\Python310\site-packages\openai\”, line 407, in _stream_events
sys.stdout.write("\nJob complete! Status: succeeded \U0001f389")
File “C:\Python310\lib\encodings\”, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\U0001f389’ in position 34: character maps to

This means that file has non-UTF8 characters. You’ll want to check the file and position 34 to look for anything off.

1 Like

I actually don’t see C:\Python310\lib\ in my file explorer at all.
Am I missing something obvious?