Closed bryanzhou008 closed 1 month ago
This was fixed by #2989. It has been merged into main branch of HELM, but it is currently not in the latest PyPI package yet.
The new o1 models use max_completion_tokens
instead of max_tokens
in the request API, for reasons explained in this OpenAI doc.
Yes, I actually ran into this error when using the latest Github version of HELM. After the openai_client adds the 'max_completion_tokens' argument to raw_request and calls self.client.chat.completions.create(**raw_request).model_dump(mode="json"), this results in the error described above. I'm not sure if there is anything else I need to change in adapter_spec.py or elsewhere for running o1 series models?
Could you provide instructions for reproducing this bug, ideally either a run entry or a Python script?
Sure, here is a simple way to reproduce this bug:
git clone --recursive https://github.com/stanford-crfm/helm.git
# Create and activate the virtual environment.
conda create -n crfm-helm python=3.9 pip
conda activate crfm-helm
# Install helm dependencies
./install-dev.sh
# add openai api key to prod_env/credentials.conf
# Create a run specs configuration
echo 'entries: [{description: "mmlu:subject=philosophy,model=openai/o1-preview-2024-09-12", priority: 1}]' > run_entries.conf
# Run benchmark
helm-run --conf-paths run_entries.conf --suite v1 --max-eval-instances 10```
Could you update your openai library and try again:
pip install --upgrade 'openai>=1.45.0'
The o1 models require at least version 1.45.0 according to the changelog.
It worked after updating the library, thanks much!
Welcome, glad that worked!
I'm getting the following error when running O1 series models, it seems that some of the utility calls cannot accept the new argument 'max_completion_tokens'? I could also be mistaken, not exactly sure why this is happening.