Closed kohane27 closed 6 months ago
@kohane27 Hey, nil
won't help because in lua assigning a nil to a key in a map table removes the key from the table:
:lua print(vim.inspect({something = nil}))
will return {}
and the setup function won't see whisper_dir
inside the user conf at all.
In the latest version you could use for example empty table whisper_dir = {}
to skip the folder creation, but I'd rather solve the underlying issue.
What system are you using? Could you run me an equivalent of:
$ ls -lah /tmp/ | grep gp_whisper
drwxr-xr-x 2 tibor users 40 Dec 20 13:13 gp_whisper
I'm able to emulate the bug on linux, if I manually make /tmp/gp_whisper
a file instead of a dir.
@Robitx Thank you for getting back to me. I really appreciate it.
I'm now using whisper_dir = {}
.
I'm on linux (Linux 6.6.7-arch1-1):
➜ ls -lah /tmp/ | grep gp_whisper
drwxr-xr-x - username 21 Dec 11:07 gp_whisper/
Thank you again!
@kohane27 yeah, no problem, sorry for not getting to it sooner.
I still don't understand it and it bugs me. :slightly_smiling_face: The /tmp/gp_whisper/
on your machine (I'm on arch too btw.) is clearly a dir.
The folder creation in gp uses the standard pattern:
if vim.fn.isdirectory(dir) == 0 then
M.info("creating directory " .. dir)
vim.fn.mkdir(dir, "p")
end
And the only way I could get to the same message is by creating the /tmp/gp_whisper
as a file.
Are you able to replicate the bug if you rm -r /tmp/gp_whisper
and start Neovim again? Or if you don't want to spent more time on it, we can close this and wait if someone with the same issue comes around.
@Robitx Thank you for getting back to me. I appreciate it.
I couldn't reproduce the issue after rm -r /tmp/gp_whisper
. I tried the following:
require("gp").setup({
openai_api_key = os.getenv("OPENAI_API_KEY"),
cmd_prefix = "Gp",
curl_params = { "--proxy", "http://127.0.0.1:8888" },
-- whisper_dir = {},
})
rm -f /tmp/gp_whisper /tmp/gp_images
Open a file and get the following:
Gp: creating directory /tmp/gp_whisper
Gp: creating directory /tmp/gp_images
find /tmp -name 'gp*'
:/tmp/gp_whisper
/tmp/gp_images
If I create /tmp/gp_whisper
as a file then the error occurs.
I think it may be due to some migration? I installed gp.nvim
quite some time ago and I think this project has undergone a lot of changes (I remember I saw some msg about gp.nvim upgrade.). So the migration period might have messed something up? Regardless, this problem doesn't exist anymore so I'll close it. If this bug creeps up again I'll re-open it.
Thank you again!
Hello! Hope you're doing well. Thank you for creating this awesome llm plugin! I enjoy it a lot.
However, every time I start up my nvim I have the following error:
My config:
I thought adding the line
whisper_dir = nil,
would solve it, but it doesn't.Any input is much appreciated. Thank you.