SakanaAI / AI-Scientist

The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery 🧑‍🔬
Apache License 2.0
8.22k stars 1.15k forks source link

Response Status Code: 429 - Too many requests #133

Open roovy54 opened 1 month ago

roovy54 commented 1 month ago

I was running this code snippet

python launch_scientist.py --model "gpt-4o-2024-05-13" --experiment nanoGPT_lite --num-ideas 1

and I get this error


Using OpenAI API with model gpt-4o-2024-05-13.

Generating idea 1/1
Iteration 1/3
{'Name': 'dynamic_dropout', 'Title': 'Dynamic Dropout: Adaptive Regularization for Efficient Training of Language Models', 'Experiment': 'Implement a mechanism to adjust the dropout rate dynamically based on the training iteration. Modify the `CausalSelfAttention`, `MLP`, and other relevant classes to accept a dynamic dropout rate. Use a simple schedule for dropout rate adjustment, such as linear decay or cosine annealing. Track the training progress and adjust the dropout rate accordingly. Compare the training dynamics, convergence speed, and final performance with the baseline model.', 'Interestingness': 7, 'Feasibility': 6, 'Novelty': 5}
Iteration 2/3
{'Name': 'dynamic_dropout', 'Title': 'Dynamic Dropout: Adaptive Regularization for Efficient Training of Language Models', 'Experiment': 'Implement a mechanism to adjust the dropout rate dynamically based on the training iteration. Modify the `CausalSelfAttention`, `MLP`, and other relevant classes to accept a dynamic dropout rate. Use a simple schedule for dropout rate adjustment, such as linear decay or cosine annealing. Track the training progress and adjust the dropout rate accordingly. Compare the training dynamics, convergence speed, and final performance with the baseline model.', 'Interestingness': 7, 'Feasibility': 6, 'Novelty': 5}
Idea generation converged after 2 iterations.

Checking novelty of idea 0: adaptive_block_size
Response Status Code: 429
Response Content: {"message": "Too Many Requests. Please wait and try again or apply for a key for higher rate limits. https://www.semanticscholar.org/product/api#api-key-form", "code": "429"}
Backing off 0.7 seconds after 1 tries calling function search_for_papers at 04:47:24
Response Status Code: 429
Response Content: {"message": "Too Many Requests. Please wait and try again or apply for a key for higher rate limits. https://www.semanticscholar.org/product/api#api-key-form", "code": "429"}
Backing off 0.2 seconds after 2 tries calling function search_for_papers at 04:47:25
Response Status Code: 429
Response Content: {"message": "Too Many Requests. Please wait and try again or apply for a key for higher rate limits. https://www.semanticscholar.org/product/api#api-key-form", "code": "429"}
Backing off 1.3 seconds after 3 tries calling function search_for_papers at 04:47:26
Response Status Code: 429
Response Content: {"message": "Too Many Requests. Please wait and try again or apply for a key for higher rate limits. https://www.semanticscholar.org/product/api#api-key-form", "code": "429"}
Backing off 5.6 seconds after 4 tries calling function search_for_papers at 04:47:28
object address  : 0x7e15e6067340
object refcount : 2
object type     : 0x879400
object type name: KeyboardInterrupt
object repr     : KeyboardInterrupt()
lost sys.stderr
^C```
arundasan91 commented 1 month ago

Check https://github.com/SakanaAI/AI-Scientist/issues/84.

xprabhudayal commented 1 month ago

@roovy54 you can apply for an api key for the semantic scholar in their website https://www.semanticscholar.org/product/api#api-key

OjashKush commented 1 month ago

Hi @roovy54, @arundasan91, @corochann

I'd like to help resolve this issue by: Adjusting API call frequency with rate limiting. Adding a retry mechanism for handling 429 errors. Could you provide any context or guidance on existing efforts, preferred approaches, or testing requirements before I proceed?

Thanks, and I’ll wait for your confirmation before starting the implementation!