Open bernardocaldas opened 1 year ago
Same problem
same here
@bernardocaldas - are you running in an OpenAI free trial account? It has an RPM (requests per minute) of 3. and n=3 is exactly that limit. You could try dropping it from 3 -> 2.
No, I'm on a paid account
And setting max_calls_per_min=2 on the llm doesn't solve it, unfortunately
Passing llm=guidance.llms.OpenAI("gpt-3.5-turbo") when you are initialising guidance object worked for me. ex. prompt = guidance('''PROMPT''', llm =guidance.llms.OpenAI("gpt-3.5-turbo"))
This seems like an openai issue and not a guidance issue, but perhaps I am missing something.
Fixed for me by specifically stating the api key for guidance.
I had set it for openai only.
I'm still having this problem despite my attempts... I've never managed to get one of the examples to work. Am I the only one?
Any solutions to this error? I have it too. It is very strange. Sometimes there is error, the other times it is good.
When running the first example of the tutorial notebook, I get a RateLimit error:
import guidance
Exception Traceback (most recent call last) Cell In[23], line 4 1 # we can use the {{gen}} command to generate text from the language model 2 # note that we used a ~ at the start of the command tag to remove the whitespace before it (just like in Handlebars) 3 program = guidance('''The best thing about the beach is {{~gen 'best' temperature=0.7 max_tokens=7}}''') ----> 4 program()
File ~/.python/current/lib/python3.10/site-packages/guidance/_program.py:234, in Program.call(self, **kwargs) 232 return self._stream_run(loop, new_program) 233 else: --> 234 loop.run_until_complete(new_program.execute()) 236 return new_program
File ~/.local/lib/python3.10/site-packages/nest_asyncio.py:90, in _patch_loop..run_until_complete(self, future) 87 if not f.done(): 88 raise RuntimeError( 89 'Event loop stopped before Future completed.') ---> 90 return f.result()
File ~/.python/current/lib/python3.10/asyncio/futures.py:201, in Future.result(self) 199 self.__log_traceback = False 200 if self._exception is not None: --> 201 raise self._exception 202 return self._result ... --> 531 raise Exception(f"Too many (more than {self.llm.max_retries}) OpenAI API RateLimitError's in a row!") 533 if stream: 534 return self.llm.stream_then_save(out, key, stop_regex, n)
Exception: Too many (more than 5) OpenAI API RateLimitError's in a row!