Hi,
when I ran the following codes, it raised runtime errors.
from alpaca_farm.auto_annotations import PairwiseAutoAnnotator
import json
with open("alpaca_farm/examples/data/outputs_pairs.json") as f:
outputs_pairs = json.load(f)
annotator = PairwiseAutoAnnotator()
annotated = annotator.annotate_pairs(outputs_pairs)
INFO:root:Creating the annotator from annotator_pool_v0
.
INFO:root:Saving annotations to /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json
.
INFO:root:Loading all annotations from /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json.
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]INFO:root:Annotating 0 examples with gpt4_1
INFO:root:Annotating 0 examples with gpt4_2
INFO:root:Annotating 0 examples with gpt4_3
INFO:root:Annotating 0 examples with gpt4_4
INFO:root:Annotating 1 examples with gpt4_5
INFO:root:Using openai_completions
on 1 prompts using gpt-4-0314.
INFO:root:Kwargs to completion: {'max_tokens': 250, 'temperature': 1.0}
INFO:root:Kwargs to completion: {'n': 1, 'model': 'gpt-4-0314', 'is_chat': True, 'max_tokens': 250, 'temperature': 1.0}
INFO:root:Creating the annotator from annotator_pool_v0
. | 0/1 [00:00<?, ?it/s]
INFO:root:Creating the annotator from annotator_pool_v0
.
INFO:root:Creating the annotator from annotator_pool_v0
.
INFO:root:Creating the annotator from annotator_pool_v0
.
INFO:root:Saving annotations to /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json
.
INFO:root:Loading all annotations from /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json.
INFO:root:Saving annotations to /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json
.
INFO:root:Loading all annotations from /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json.
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]INFO:root:Saving annotations to /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json
.
INFO:root:Loading all annotations from /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json.
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]INFO:root:Annotating 0 examples with gpt4_1
INFO:root:Saving annotations to /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json
.
INFO:root:Loading all annotations from /Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_farm/auto_annotations/annotators/annotator_pool_v0/annotations_seed0_configs.json.
INFO:root:Annotating 0 examples with gpt4_2
INFO:root:Annotating 0 examples with gpt4_3
INFO:root:Annotating 0 examples with gpt4_4
INFO:root:Annotating 0 examples with gpt4_1
INFO:root:Annotating 0 examples with gpt4_2
INFO:root:Annotating 0 examples with gpt4_1
INFO:root:Annotating 1 examples with gpt4_5
INFO:root:Annotating 0 examples with gpt4_3
INFO:root:Annotating 0 examples with gpt4_2
INFO:root:Annotating 0 examples with gpt4_3
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]INFO:root:Annotating 0 examples with gpt4_4
INFO:root:Annotating 0 examples with gpt4_4
INFO:root:Annotating 1 examples with gpt4_5
INFO:root:Annotating 1 examples with gpt4_5
INFO:root:Annotating 0 examples with gpt4_1
INFO:root:Annotating 0 examples with gpt4_2
INFO:root:Annotating 0 examples with gpt4_3
INFO:root:Annotating 0 examples with gpt4_4
INFO:root:Annotating 1 examples with gpt4_5
INFO:root:Using openai_completions
on 1 prompts using gpt-4-0314.
INFO:root:Kwargs to completion: {'max_tokens': 250, 'temperature': 1.0}
INFO:root:Kwargs to completion: {'n': 1, 'model': 'gpt-4-0314', 'is_chat': True, 'max_tokens': 250, 'temperature': 1.0}
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "", line 1, in
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 289, in run_path
INFO:root:Using openai_completions
on 1 prompts using gpt-4-0314.
INFO:root:Using openai_completions
on 1 prompts using gpt-4-0314.
INFO:root:Using openai_completions
on 1 prompts using gpt-4-0314.
INFO:root:Kwargs to completion: {'max_tokens': 250, 'temperature': 1.0}
INFO:root:Kwargs to completion: {'n': 1, 'model': 'gpt-4-0314', 'is_chat': True, 'max_tokens': 250, 'temperature': 1.0}
return _run_module_code(code, init_globals, run_name,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 96, in _run_module_code
INFO:root:Kwargs to completion: {'max_tokens': 250, 'temperature': 1.0}
INFO:root:Kwargs to completion: {'n': 1, 'model': 'gpt-4-0314', 'is_chat': True, 'max_tokens': 250, 'temperature': 1.0}
_run_code(code, mod_globals, init_globals,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/langhao/cycle_rlhf/test.py", line 12, in
annotated = annotator.annotate_pairs(outputs_pairs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/pairwise_evaluator.py", line 263, in annotate_pairs
return self.call(to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 167, in call
INFO:root:Kwargs to completion: {'max_tokens': 250, 'temperature': 1.0}
df_annotated = self._annotate(curr_df_to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 254, in _annotate
curr_annotated = self.annotators[annotator](
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 562, in call
INFO:root:Kwargs to completion: {'n': 1, 'model': 'gpt-4-0314', 'is_chat': True, 'max_tokens': 250, 'temperature': 1.0}
completions = self.fn_completions(prompts=prompts, **self.completions_kwargs, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/decoders/openai.py", line 138, in openai_completions
with multiprocessing.Pool(num_procs) as p:
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 215, in init
self._repopulate_pool()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
return Popen(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "", line 1, in
Annotation chunk: 0%| | 0/1 [00:00<?, ?it/s]
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
Traceback (most recent call last):
File "", line 1, in
Traceback (most recent call last):
File "", line 1, in
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
exitcode = _main(fd, parent_sentinel)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
exitcode = _main(fd, parent_sentinel)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
prepare(preparation_data)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
prepare(preparation_data)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 289, in run_path
main_content = runpy.run_path(main_path,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 86, in _run_code
return _run_module_code(code, init_globals, run_name,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 96, in _run_module_code
exec(code, run_globals)
File "/Users/langhao/cycle_rlhf/test.py", line 12, in
annotated = annotator.annotate_pairs(outputs_pairs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/pairwise_evaluator.py", line 263, in annotate_pairs
_run_code(code, mod_globals, init_globals,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
return self.call(to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 167, in call
File "/Users/langhao/cycle_rlhf/test.py", line 12, in
annotated = annotator.annotate_pairs(outputs_pairs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/pairwise_evaluator.py", line 263, in annotate_pairs
df_annotated = self._annotate(curr_df_to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 254, in _annotate
return self.call(to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 167, in call
curr_annotated = self.annotators[annotator](
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 562, in call
completions = self.fn_completions(prompts=prompts, **self.completions_kwargs, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/decoders/openai.py", line 138, in openai_completions
with multiprocessing.Pool(num_procs) as p:
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 215, in init
self._repopulate_pool()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
return Popen(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
_fixup_main_from_path(data['init_main_from_path'])
df_annotated = self._annotate(curr_df_to_annotate, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 254, in _annotate
curr_annotated = self.annotators[annotator](
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/annotators/base.py", line 562, in call
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
completions = self.fn_completions(prompts=prompts, **self.completions_kwargs, **decoding_kwargs)
File "/Users/langhao/conda/envs/py310/lib/python3.10/site-packages/alpaca_eval/decoders/openai.py", line 138, in openai_completions
main_content = runpy.run_path(main_path,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 289, in run_path
with multiprocessing.Pool(num_procs) as p:
File "/Users/langhao/conda/envs/py310/lib/python3.10 return _run_module_code(code, init_globals, run_name,
File "/Users/langhao/conda/envs/py310/lib/python3.10/runpy.py", line 96, in _run_module_code
/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 215, in init
self._repopulate_pool()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
return Popen(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/Users/langhao/conda/envs/py310/lib/python3.10/multiprocessing/popen_fork.py", line 19, in init