Finally got tiktoken luarock working with Windows and PowerShell - How To Guide #386
GitMurf
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
I will submit a PR to add to the README once I have vetted this fully out, get some feedback and get confirmation from someone else they are able to get tiktoken working on Windows using these instructions. I don't want to forget any of the steps while they are fresh in my mind!
Gotchas
Modify the suggested luarocks install command from the README
README location to amend
Currently the README has some incorrect info for Windows / PowerShell users with this documented command:
sudo luarocks install --lua-version 5.1 tiktoken_coreCorrections to work with Windows:
sudoas that is not a Windows / PowerShell thing.=equals instead of a space between--lua-version 5.1luarocks install --lua-version=5.1 tiktoken_coreSave the binary as tiktoken_core.so in any of the given pathswhich confused me for a bit because on Windows it is.dllinstead of.so(see next section below).Confusion with
tiktoken_core.sovstiktoken_core.dllIn my reading and research on luarocks and the ecosystem, I saw a ton about
*.sofiles but hardly anything about*.dllfiles. This is because*.dllis the Windows equivalent of*.soon Mac / Linux. So you can think of them as synonymous.The initial
Lua for Windows all-in-one packagehas older version of luarocksAs you see in steps 2 - 8 below, it took me a while to realize that while you need to use the "all-in-one package" for the initial installation of Lua / LuaRocks for Windows, you then need to "update" luarocks by downloading the newest win32 binary (step 2 below) and place it in the Lua 5.1 install directory (step 6 below) so that the newest version of luarocks is used instead of the default old one.
Step by Step
Lua for Windows all-in-one packagehere: https://github.com/rjpcomputing/luaforwindows/releases/tag/v5.1.5-52stand-aloneluarocks.exe binary which should be titled:luarocks-3.11.1-windows-32.zipluarocks.exeandluarocks-admin.exefiles from the extracted zip to your Lua / LuaRocks install directory which should be something like this:C:\Program Files (x86)\Lua\5.1\where.execommand line tool installed, you can usewhere.exe luarocksto find the path.luarocksis now updated to v3.11.1 by runningluarocks --versionluarocks install --lua-version=5.1 tiktoken_coreluarocks-build-rust-mluabut should auto install that for you as well.luarocks-build-rust-mluafor you, go ahead and install it separately withluarocks install --lua-version=5.1 luarocks-build-rust-mluatiktokento somewhere like:C:\Users\USER_NAME\AppData\Roaming\luarocks\LUA_CPATH(mine was NOT set by default).luarocks path --lr-cpath.That is it! Now if you restart PowerShell and startup Neovim, tiktoken should be working. You can validate it is by running the health check:
checkhealth CopilotChat.Beta Was this translation helpful? Give feedback.
All reactions