Hi, I am using colab for a fine tunes test. Here is my code:
!pip install --upgrade openai
import os
import openai
openai.organization = “lexata”
openai.api_key = “my key here”
#openai.Engine.list()
import re
import json
import pandas as pd
import openai
import string
import requests
import random
!openai tools fine_tunes.prepare_data -f /content/lex_train.json
The above worked yesterday and I accepted all of the suggestions to modify my file, and then I was able to get a small model trained and ready to test. Unfortunately, I am not technical so today on colab I seem to have lost my work from yesterday (I think). So I tried the above code again and I get the following message: ValueError: Expected object or value.
Can anyone help me troubleshoot? Thanks very much.
Here is the full output:
Analyzing…
Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/openai/validators.py”, line 510, in read_any_format
df = pd.read_json(fname, lines=True, dtype=str)
File “/usr/local/lib/python3.7/dist-packages/pandas/util/_decorators.py”, line 207, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/pandas/util/_decorators.py”, line 311, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 614, in read_json
return json_reader.read()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 746, in read
obj = self._get_object_parser(self._combine_lines(data_lines))
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 770, in _get_object_parser
obj = FrameParser(json, **kwargs).parse()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 885, in parse
self._parse_no_numpy()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 1140, in _parse_no_numpy
loads(json, precise_float=self.precise_float), dtype=None
ValueError: Expected object or value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/bin/openai”, line 71, in
sys.exit(main())
File “/usr/local/bin/openai”, line 62, in main
args.func(args)
File “/usr/local/lib/python3.7/dist-packages/openai/cli.py”, line 421, in prepare_data
df, remediation = read_any_format(fname)
File “/usr/local/lib/python3.7/dist-packages/openai/validators.py”, line 512, in read_any_format
df = pd.read_json(fname, dtype=str)
File “/usr/local/lib/python3.7/dist-packages/pandas/util/_decorators.py”, line 207, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/pandas/util/_decorators.py”, line 311, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 614, in read_json
return json_reader.read()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 748, in read
obj = self._get_object_parser(self.data)
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 770, in _get_object_parser
obj = FrameParser(json, **kwargs).parse()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 885, in parse
self._parse_no_numpy()
File “/usr/local/lib/python3.7/dist-packages/pandas/io/json/_json.py”, line 1140, in _parse_no_numpy
loads(json, precise_float=self.precise_float), dtype=None
ValueError: Expected object or value