Skip to content

Commit

Permalink
fix(tiktoken): add nil check for model before call tiktoken
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Jul 29, 2024
1 parent 8a8a60f commit 45318b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/CopilotChat/tiktoken.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end
local function load_tiktoken_data(done, model)
local tiktoken_url = 'https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken'
-- If model is gpt-4o, use o200k_base.tiktoken
if vim.startswith(model, 'gpt-4o') then
if model ~= nil and vim.startswith(model, 'gpt-4o') then
tiktoken_url = 'https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken'
end
local async
Expand Down

0 comments on commit 45318b2

Please sign in to comment.