You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the judgelm_preprocess.py script, I encountered a KeyError: 'scores' error. It appears that the script expects a scores field in the JSON files, but the documentation does not mention that this field is required. Here are the details:
Steps to Reproduce:
Clone the repository: git clone https://github.com/baaivision/JudgeLM
Navigate to the directory: cd JudgeLM
Create and activate a conda environment.
Install the required dependencies: pip install -r requirements.txt
Run the preprocessing script with the following command:
Traceback (most recent call last):
File "C:/Users/mliki/JudgeLM/judgelm/data/JudgeLM/judgelm_preprocess.py", line 95, in <module>
combine_judgelm_val_judge_samples(args.ans1_file_path, args.ans2_file_path, args.ansmore_file_paths)
File "C:/Users/mliki/JudgeLM/judgelm/data/JudgeLM/judgelm_preprocess.py", line 18, in combine_judgelm_val_judge_samples
ans1_dict_list = extract_jsonl(ans1_file_path)
File "C:/Users/mliki/JudgeLM/judgelm/utils.py", line 26, in extract_jsonl
data = json.loads(line)
File "C:/Users/mliki/anaconda3/envs/judgelm/lib/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:/Users/mliki/anaconda3/envs/judgelm/lib/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:/Users/mliki/anaconda3/envs/judgelm/lib/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/mliki/JudgeLM/judgelm/data/JudgeLM/judgelm_preprocess.py", line 36, in combine_judgelm_val_judge_samples
'score': [ans1_dict['scores'], ans2_dict['scores']],
KeyError: 'scores'
Suggested Fix:
Either update the documentation to specify that the scores field is required in the JSON files.
Or, modify the script to handle cases where the scores field is not present.
I have made a temporary modification to the script to handle missing scores fields by using default values. Here is the updated function:
When running the judgelm_preprocess.py script, I encountered a
KeyError: 'scores'
error. It appears that the script expects ascores
field in the JSON files, but the documentation does not mention that this field is required. Here are the details:Steps to Reproduce:
git clone https://github.com/baaivision/JudgeLM
cd JudgeLM
pip install -r requirements.txt
Error Message:
Suggested Fix:
scores
field is required in the JSON files.scores
field is not present.I have made a temporary modification to the script to handle missing
scores
fields by using default values. Here is the updated function:Please let me know if there are any other suggestions or if I should make further modifications. Thank you!
The text was updated successfully, but these errors were encountered: