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
-
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_core
Corrections to work with Windows:
sudo
as that is not a Windows / PowerShell thing.=
equals instead of a space between--lua-version 5.1
luarocks install --lua-version=5.1 tiktoken_core
Save the binary as tiktoken_core.so in any of the given paths
which confused me for a bit because on Windows it is.dll
instead of.so
(see next section below).Confusion with
tiktoken_core.so
vstiktoken_core.dll
In my reading and research on luarocks and the ecosystem, I saw a ton about
*.so
files but hardly anything about*.dll
files. This is because*.dll
is the Windows equivalent of*.so
on Mac / Linux. So you can think of them as synonymous.The initial
Lua for Windows all-in-one package
has 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 package
here: https://github.com/rjpcomputing/luaforwindows/releases/tag/v5.1.5-52stand-alone
luarocks.exe binary which should be titled:luarocks-3.11.1-windows-32.zip
luarocks.exe
andluarocks-admin.exe
files from the extracted zip to your Lua / LuaRocks install directory which should be something like this:C:\Program Files (x86)\Lua\5.1\
where.exe
command line tool installed, you can usewhere.exe luarocks
to find the path.luarocks
is now updated to v3.11.1 by runningluarocks --version
luarocks install --lua-version=5.1 tiktoken_core
luarocks-build-rust-mlua
but should auto install that for you as well.luarocks-build-rust-mlua
for you, go ahead and install it separately withluarocks install --lua-version=5.1 luarocks-build-rust-mlua
tiktoken
to 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