David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
992 stars 64 forks source link

model change doesn't work #42

Closed kapral18 closed 7 months ago

kapral18 commented 8 months ago

with a lazyvim setup

vim.api.nvim_create_user_command("ChangeModel", function()
  vim.ui.input({ prompt = "Enter new model: " }, function(input)
    if input and input ~= "" then
      require("gen").model = input
      print("Model changed to: " .. input)
    else
      print("No model name provided. Model not changed.")
    end
  end)
end, {})

return {
  "David-Kunz/gen.nvim",
  keys = {
    { "<leader>ai", ":Gen<CR>", mode = { "n", "v", "x" }, desc = "Local AI Gen" },
    { "<leader>am", ":ChangeModel<CR>", mode = { "n" }, desc = "Change Model" },
  },
  config = function()
    local opts = {
      model = "deepseek-coder:33b-instruct-q4_0",
      display_mode = "float",
      show_model = true,
      no_serve = true,
      debugCommand = true,
    }

    local gen = require("gen")

    gen.model = opts.model
    gen.display_mode = opts.display_mode
    gen.show_model = opts.show_model
    gen.no_serve = opts.no_serve
  end,
}

for some reason after changing model there is no response even tho initially it works fine. I tried different models result is the same blank window.

Any clues?

David-Kunz commented 7 months ago

Hi @kapral18 ,

Thanks for reporting, I fixed the issue!

Best regards, David

kapral18 commented 7 months ago

@David-Kunz thanks for resolving