when I run !python promptcitationclassification/tuningfree/main.py \ --method…
Private research annotation
Sign in to add a private research label or note.
- User
when I run !python prompt_citation_classification/tuning_free/main.py
--method "zero_shot_reason"
--input_file 'test.txt'
--model 'gpt3.5'
--output_dir output/
--dataset ${dataset_name}I get this error:
Traceback (most recent call last): File "/content/prompt_citation_classification/tuning_free/main.py", line 10, in from utils import * File "/content/prompt_citation_classification/tuning_free/utils.py", line 19, in from openai.error import RateLimitError ModuleNotFoundError: No module named 'openai.error'
why ?
Assistant
This error occurs because you're using an outdated import statement that's not compatible with the latest versions of the OpenAI Python package. The error
ModuleNotFoundError: No module named 'openai.error'indicates that the import path for RateLimitError has changed in newer versions of the openai package.To fix this, there are two approaches:
- If you're using OpenAI API version 1.0.0 or newer, modify the import in
utils.pyfrom:
pythonfrom openai.error import RateLimitErrorto:
pythonfrom openai import RateLimitError- Alternatively, you can install a specific older version of the openai package that maintains the old import structure:
bashpip install openai==0.28.0Looking at the repository code, it appears this code was written for an older version of the OpenAI API. The most straightforward fix would be to install the older version of the package since the code may have other dependencies on the older API structure.
- If you're using OpenAI API version 1.0.0 or newer, modify the import in
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.