scottleibrand / gpt-summarizer

Extract text from PDF, summarize each section w/ GPT, and provide a summarized outline of the paper
MIT License
188 stars 27 forks source link

"The model `text-davinci-003` has been deprecated" #12

Open ArnaudHureaux opened 5 months ago

ArnaudHureaux commented 5 months ago

I just followed the tutorial with a normal PDF

Below the full error :

PS C:\Users\hurea\1MyCode\PERSO\book_summarizer\gpt-summarizer> python summarize.py bap_bam.pdf
Found 1 sections. Token indices sequence length is longer than the specified maximum sequence length for this model (103563 > 1024). Running this sequence through the model will result in indexing errors Text extracted from bap_bam.pdf and written to bap_bam.full.txt ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\1MyCode\PERSO\book_summarizer\gpt-summarizer\summarize.py", line 268, in generate_summary completions = openai.Completion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\1MyCode\PERSO\book_summarizer\gpt-summarizer\summarize.py", line 268, in generate_summary completions = openai.Completion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\completion.py", line 25, in create return super().create(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\abstract\engine_apiresource.py", line 153, in create response, , api_key = requestor.request( ^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hurea\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 619, in _interpret_response self._interpret_response_line( File "C:\Users\hurea\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 682, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: The model text-davinci-003 has been deprecated, learn more here: https://platform.openai.com/docs/deprecations

scottleibrand commented 5 months ago

Yeah, the approach taken in this repo isn't needed any more. You can simply paste your entire text into GPT-4-Turbo with a "please summarize this" prompt of whatever level of detail you want. Claude 2 is also good for long-context tasks like that.