From 9cecb731fcc357b733f0c1f9d5f7eaf516659f24 Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 22 Sep 2023 01:21:05 +0100 Subject: [PATCH] Close #38 - Default to gpt-3.5-turbo-instruct Default OpenAI to gpt-3.5-turbo-instruct, which performs better and returns decent results. --- autoload/neural/config.vim | 2 +- doc/neural.txt | 2 +- test/python/test_openai.py | 10 +++++----- test/vim/test_config.vader | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autoload/neural/config.vim b/autoload/neural/config.vim index f6f6183..0e14f53 100644 --- a/autoload/neural/config.vim +++ b/autoload/neural/config.vim @@ -22,7 +22,7 @@ let s:defaults = { \ 'api_key': '', \ 'frequency_penalty': 0.1, \ 'max_tokens': 1024, -\ 'model': 'text-davinci-003', +\ 'model': 'gpt-3.5-turbo-instruct', \ 'presence_penalty': 0.1, \ 'temperature': 0.2, \ 'top_p': 1, diff --git a/doc/neural.txt b/doc/neural.txt index f20e5b8..9261c8a 100644 --- a/doc/neural.txt +++ b/doc/neural.txt @@ -230,7 +230,7 @@ g:neural.source.openai.max_tokens *g:neural.source.openai.max_tokens* g:neural.source.openai.model *g:neural.source.openai.model* *vim.g.neural.source.openai.model* Type: |String| - Default: `'text-davinci-003'` + Default: `'gpt-3.5-turbo-instruct'` The model to use for OpenAI. Please consult OpenAI's documentation for more information on models: https://platform.openai.com/docs/models/overview diff --git a/test/python/test_openai.py b/test/python/test_openai.py index 6b2035f..4f42fdf 100644 --- a/test/python/test_openai.py +++ b/test/python/test_openai.py @@ -88,15 +88,15 @@ def test_main_function_rate_other_error(): def test_print_openai_results(): result_data = ( - b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "\\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "text-davinci-003"}\n' # noqa + b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "\\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"}\n' # noqa b'\n' - b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "\\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "text-davinci-003"}\n' # noqa + b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "\\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"}\n' # noqa b'\n' - b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "Hello", "index": 0, "logprobs": null, "finish_reason": null}], "model": "text-davinci-003"}\n' # noqa + b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "Hello", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"}\n' # noqa b'\n' - b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "!", "index": 0, "logprobs": null, "finish_reason": null}], "model": "text-davinci-003"}\n' # noqa + b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "!", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"}\n' # noqa b'\n' - b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "", "index": 0, "logprobs": null, "finish_reason": "stop"}], "model": "text-davinci-003"}\n' # noqa + b'data: {"id": "cmpl-6jMlRJtbYTGrNwE6Lxy1Ns1EtD0is", "object": "text_completion", "created": 1676270285, "choices": [{"text": "", "index": 0, "logprobs": null, "finish_reason": "stop"}], "model": "gpt-3.5-turbo-instruct"}\n' # noqa b'\n' b'data: [DONE]\n' b'\n' diff --git a/test/vim/test_config.vader b/test/vim/test_config.vader index caa1fad..db31526 100644 --- a/test/vim/test_config.vader +++ b/test/vim/test_config.vader @@ -44,7 +44,7 @@ Execute(The default openai settings should be correct): \ 'api_key': '', \ 'frequency_penalty': 0.1, \ 'max_tokens': 1024, - \ 'model': 'text-davinci-003', + \ 'model': 'gpt-3.5-turbo-instruct', \ 'presence_penalty': 0.1, \ 'temperature': 0.2, \ 'top_p': 1,