Hello. I am going through the “Chat with your Data” course, presently on Retrieval and getting the “RateLimitError: exceeded quota for this month.” Can you advise?
Best,
J.
This happens when you have an embedder and submit more data than you think you are.
I’m not sure I can exactly put my finger as to why, but if you are submitting a list, try giving the chain just a few elements (ie: [:10] )
Thank you for taking the time to respond. I did not change anything in the notebook. Just ran the cells while watching the videos.
This is from the “Document Loading” session:
[youtube] Extracting URL: Stanford CS229: Machine Learning Course, Lecture 1 - Andrew Ng (Autumn 2018) - YouTube
[youtube] jGwO_UgTS7I: Downloading webpage
[youtube] jGwO_UgTS7I: Downloading android player API JSON
[info] jGwO_UgTS7I: Downloading 1 format(s): 140
[download] docs/youtube//Stanford CS229: Machine Learning Course, Lecture 1 - Andrew Ng (Autumn 2018).m4a has already been downloaded
[download] 100% of   69.71MiB
[ExtractAudio] Not converting audio docs/youtube//Stanford CS229: Machine Learning Course, Lecture 1 - Andrew Ng (Autumn 2018).m4a; file is already in target format m4a
Transcribing part 1!
RateLimitError                            Traceback (most recent call last)
Cell In[10], line 7
2 save_dir=“docs/youtube/”
3 loader = GenericLoader(
4     YoutubeAudioLoader([url],save_dir),
5     OpenAIWhisperParser()
6 )
----> 7 docs = loader.load()
File /usr/local/lib/python3.9/site-packages/langchain/document_loaders/generic.py:90, in GenericLoader.load(self)
88 def load(self) → List[Document]:
89     “”“Load all documents.”“”
—> 90     return list(self.lazy_load())
File /usr/local/lib/python3.9/site-packages/langchain/document_loaders/generic.py:86, in GenericLoader.lazy_load(self)
84 “”“Load documents lazily. Use this when working at a large scale.”“”
85 for blob in self.blob_loader.yield_blobs():
—> 86     yield from self.blob_parser.lazy_parse(blob)
File /usr/local/lib/python3.9/site-packages/langchain/document_loaders/parsers/audio.py:51, in OpenAIWhisperParser.lazy_parse(self, blob)
49 # Transcribe
50 print(f"Transcribing part {split_number+1}!")
—> 51 transcript = openai.Audio.transcribe(“whisper-1”, file_obj)
53 yield Document(
54     page_content=transcript.text,
55     metadata={“source”: blob.source, “chunk”: split_number},
56 )
File /usr/local/lib/python3.9/site-packages/openai/api_resources/audio.py:57, in Audio.transcribe(cls, model, file, api_key, api_base, api_type, api_version, organization, **params)
55 requestor, files, data = cls._prepare_request(file, file.name, model, **params)
56 url = cls._get_url(“transcriptions”)
—> 57 response, _, api_key = requestor.request(“post”, url, files=files, params=data)
58 return util.convert_to_openai_object(
59     response, api_key, api_version, organization
60 )
File /usr/local/lib/python3.9/site-packages/openai/api_requestor.py:226, in APIRequestor.request(self, method, url, params, headers, files, stream, request_id, request_timeout)
205 def request(
206     self,
207     method,
(…)
214     request_timeout: Optional[Union[float, Tuple[float, float]]] = None,
215 ) → Tuple[Union[OpenAIResponse, Iterator[OpenAIResponse]], bool, str]:
216     result = self.request_raw(
217         method.lower(),
218         url,
(…)
224         request_timeout=request_timeout,
225     )
 → 226     resp, got_stream = self._interpret_response(result, stream)
227     return resp, got_stream, self.api_key
File /usr/local/lib/python3.9/site-packages/openai/api_requestor.py:619, in APIRequestor._interpret_response(self, result, stream)
611     return (
612         self._interpret_response_line(
613             line, result.status_code, result.headers, stream=True
614         )
615         for line in parse_stream(result.iter_lines())
616     ), True
617 else:
618     return (
 → 619         self._interpret_response_line(
620             result.content.decode(“utf-8”),
621             result.status_code,
622             result.headers,
623             stream=False,
624         ),
625         False,
626     )
File /usr/local/lib/python3.9/site-packages/openai/api_requestor.py:679, in APIRequestor._interpret_response_line(self, rbody, rcode, rheaders, stream)
677 stream_error = stream and “error” in resp.data
678 if stream_error or not 200 <= rcode < 300:
 → 679     raise self.handle_error_response(
680         rbody, rcode, resp.data, rheaders, stream_error=stream_error
681     )
682 return resp
RateLimitError: exceeded quota for this month