parsel icon indicating copy to clipboard operation
parsel copied to clipboard

"code-davinci-002" does not exist error on colab

Open nyck33 opened this issue 1 year ago • 4 comments

Implementing SCC 0 {'select_airport_cities'}
Implementing SCC 1 {'sky_city_cost'}
Trying 8 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 16 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 32 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 64 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Traceback (most recent call last):
  File "/content/parsel/parsel.py", line 650, in <module>
    parsel(codegen, args.source_file, allow_autofill=args.allow_autofill, should_expand=args.allow_expand, debug=debug, add_name_and_args=args.add_name_and_args)
  File "/content/parsel/parsel.py", line 622, in parsel
    defined_fns = parsel_graph(defined_fns, codegen, allow_autofill, should_expand, debug)
  File "/content/parsel/parsel.py", line 590, in parsel_graph
    implement_scc(scc_idx, sccs, implemented_sccs, scc_edges, defined_fns, codegen, allow_autofill, should_expand, debug, sample_only)
  File "/content/parsel/parsel.py", line 496, in implement_scc
    dependencies_str += implement_scc(edge, sccs, implemented_sccs, scc_edges, defined_fns, codegen, allow_autofill, should_expand, debug)
  File "/content/parsel/parsel.py", line 537, in implement_scc
    raise error
  File "/content/parsel/parsel.py", line 506, in implement_scc
    fn.implement(codegen, num_completions=num_completions)
  File "/content/parsel/fn.py", line 103, in implement
    self.implementations = codex.generate(
  File "/content/parsel/codex.py", line 70, in generate
    completions = openai.Completion.create(
  File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 230, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 624, in _interpret_response
    self._interpret_response_line(
  File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 687, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model: `code-davinci-002` does not exist

I logged in and tried to run the cell with command !python3 parsel.py programs/problem_solving.ss

nyck33 avatar May 20 '23 07:05 nyck33

Same thing after I cloned the repo:

parsel) nobu@LAPTOP-DNCQ5AAC:/mnt/d/LLM/parsel$ python parsel.py programs/problem_solving.ss
Implementing SCC 0 {'select_airport_cities'}
Implementing SCC 1 {'sky_city_cost'}
Trying 8 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 16 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 32 completions
Calling Codex!
8 completions 500 tokens each
Error The model: `code-davinci-002` does not exist
Trying 64 completions
Calling Codex!
8 completions 500 tokens each
^CTraceback (most recent call last):
  File "/mnt/d/LLM/parsel/parsel.py", line 506, in implement_scc
    fn.implement(codegen, num_completions=num_completions)
  File "/mnt/d/LLM/parsel/fn.py", line 103, in implement
    self.implementations = codex.generate(
  File "/mnt/d/LLM/parsel/codex.py", line 68, in generate
    time.sleep(8)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/d/LLM/parsel/parsel.py", line 650, in <module>
    parsel(codegen, args.source_file, allow_autofill=args.allow_autofill, should_expand=args.allow_expand, debug=debug, add_name_and_args=args.add_name_and_args)
  File "/mnt/d/LLM/parsel/parsel.py", line 622, in parsel
    defined_fns = parsel_graph(defined_fns, codegen, allow_autofill, should_expand, debug)
  File "/mnt/d/LLM/parsel/parsel.py", line 590, in parsel_graph
    implement_scc(scc_idx, sccs, implemented_sccs, scc_edges, defined_fns, codegen, allow_autofill, should_expand, debug, sample_only)
  File "/mnt/d/LLM/parsel/parsel.py", line 496, in implement_scc
    dependencies_str += implement_scc(edge, sccs, implemented_sccs, scc_edges, defined_fns, codegen, allow_autofill, should_expand, debug)
  File "/mnt/d/LLM/parsel/parsel.py", line 521, in implement_scc
    raise KeyboardInterrupt
KeyboardInterrupt

nyck33 avatar May 20 '23 08:05 nyck33

text-davinci--002 is what ChatGPT told me to use so I tried that and get

(parsel) nobu@LAPTOP-DNCQ5AAC:/mnt/d/LLM/parsel$ pip install scipy
Requirement already satisfied: scipy in /home/nobu/.local/lib/python3.10/site-packages (1.10.1)
Collecting numpy<1.27.0,>=1.19.5
  Downloading numpy-1.24.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 5.5 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-1.24.3
(parsel) nobu@LAPTOP-DNCQ5AAC:/mnt/d/LLM/parsel$ python parsel.py programs/problem_solving.ss
Implementing SCC 0 {'select_airport_cities'}
Implementing SCC 1 {'sky_city_cost'}
Trying 8 completions
Attempting to implement {'sky_city_cost'}
 12%|███████▊                                                      | 1/8 [00:00<00:03,  1.95it/s]Asserts passed: 0
Error: 
Killing subprocesses
100%|██████████████████████████████████████████████████████████████| 8/8 [00:00<00:00, 11.78it/s]
Failed implementing {'sky_city_cost'}, best attempt: 0 / 1
Error No implementation found for {'sky_city_cost'}
Trying 16 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
Attempting to implement {'sky_city_cost'}
 12%|███████▋                                                     | 2/16 [00:00<00:05,  2.57it/s]Killing subprocesses
 31%|███████████████████                                          | 5/16 [00:01<00:02,  4.98it/s]
Successfully implemented {'sky_city_cost'}
Implementing SCC 2 {'minimum_spanning_tree'}
Trying 8 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
Attempting to implement {'minimum_spanning_tree'}
  0%|                                            | 0/8 [00:00<?, ?it/s]Killing subprocesses
Error No implementations found
Trying 16 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
Attempting to implement {'minimum_spanning_tree'}
                                                                      Killing subprocesses                             | 0/16 [00:00<?, ?it/s]
  0%|                                            | 0/8 [00:31<?, ?it/s]
Error No implementations found
Trying 32 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
8 completions 500 tokens each
Attempting to implement {'minimum_spanning_tree'}
  6%|██                              | 2/32 [00:00<00:13,  2.26it/s]Asserts passed: 0
Error: name 'find_component' is not defined
Killing subprocesses
 38%|███████████▋                   | 12/32 [00:01<00:01, 11.94it/s]
Failed implementing {'minimum_spanning_tree'}, best attempt: 0 / 1
  0%|                                           | 0/16 [00:53<?, ?it/s]
Error No implementation found for {'minimum_spanning_tree'}
Trying 64 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
8 completions 500 tokens each
8 completions 500 tokens each
8 completions 500 tokens each
Attempting to implement {'minimum_spanning_tree'}
 14%|█████                               | 9/64 [00:01<00:06,  8.12it/s]Killing subprocesses
 34%|████████████                       | 22/64 [00:01<00:02, 15.16it/s]
Successfully implemented {'minimum_spanning_tree'}
Implementing SCC 3 {'final_node_connectors'}
Trying 8 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
Attempting to implement {'final_node_connectors'}
  0%|                                             | 0/8 [00:00<?, ?it/s]Killing subprocesses
Error No implementations found
Trying 16 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
Attempting to implement {'final_node_connectors'}
                                                                       Killing subprocesses                      | 2/16 [00:00<00:05,  2.53it/s]
 12%|████▌                               | 2/16 [00:00<00:06,  2.00it/s]
Successfully implemented {'final_node_connectors'}
Trying 8 completions
WARNING, using davinci text model
Calling Codex!
8 completions 500 tokens each
^CTraceback (most recent call last):
  File "/mnt/d/LLM/parsel/parsel.py", line 506, in implement_scc
    fn.implement(codegen, num_completions=num_completions)
  File "/mnt/d/LLM/parsel/fn.py", line 103, in implement
    self.implementations = codex.generate(
  File "/mnt/d/LLM/parsel/codex.py", line 70, in generate
    time.sleep(8)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/d/LLM/parsel/parsel.py", line 650, in <module>
    parsel(codegen, args.source_file, allow_autofill=args.allow_autofill, should_expand=args.allow_expand, debug=debug, add_name_and_args=args.add_name_and_args)
  File "/mnt/d/LLM/parsel/parsel.py", line 622, in parsel
    defined_fns = parsel_graph(defined_fns, codegen, allow_autofill, should_expand, debug)
  File "/mnt/d/LLM/parsel/parsel.py", line 590, in parsel_graph
    implement_scc(scc_idx, sccs, implemented_sccs, scc_edges, defined_fns, codegen, allow_autofill, should_expand, debug, sample_only)
  File "/mnt/d/LLM/parsel/parsel.py", line 521, in implement_scc
    raise KeyboardInterrupt
KeyboardInterrupt
  0%|                                             | 0/8 [00:49<?, ?it/s]

Should I be seeing the solutions in the terminal?

nyck33 avatar May 20 '23 09:05 nyck33

I can see that it's using my tokens but can't tell if it's making progress on any of the problems.

image

nyck33 avatar May 20 '23 09:05 nyck33

@nyck33 The code-davinci-002 model has been deprecated. See here : https://platform.openai.com/docs/deprecations

bbourgeaux avatar Jun 27 '23 13:06 bbourgeaux