fix(tiktoken_lib): correct matching for macos (#260)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2024-08-27 02:15:33 -04:00 committed by GitHub
parent 6d52db4fa2
commit 57cf490d45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@ local M = {}
local function get_library_path()
local os_name = require("avante.utils").get_os_name()
local ext = os_name == "linux" and "so" or (os_name == "macOS" and "dylib" or "dll")
local ext = os_name == "linux" and "so" or (os_name == "darwin" and "dylib" or "dll")
local dirname = string.sub(debug.getinfo(1).source, 2, #"/tiktoken_lib.lua" * -1)
return dirname .. ("../build/?.%s"):format(ext)
end