Skip to content

Whisper with Sox in Window not worked #249

Open
@Mike20403

Description

Here's my gp.log and config

       use({
    "robitx/gp.nvim",
    config = function()
	local GROQ_KEY = "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"
	local GROQ_HOST = "https://api.groq.com/openai/v1/chat/completions"
	local GROQ_AUDIO = "https://api.groq.com/openai/v1/audio/transcriptions"
	local GROQ_WHISPER_MODEL = "distil-whisper-large-v3-en";
        local conf = {
	    whisper = {
 		   -- -- TODO: In the future, when gpnvim will support whisper options
  		  endpoint = GROQ_AUDIO,
 		   secret = GROQ_KEY,
 		   sox_path = "D:\\Add on\\sox\\sox-14-4-1\\sox.exe",
                   sox_args = { "-t", "waveaudio", "default", "--no-show-progress", "--rate", "16000", "--channels", "1", "--encoding", "signed-integer", "--bits", "16", "--endian", "little", "-" },
 		   model = GROQ_WHISPER_MODEL,
 		   store_dir = "/tmp/gp_whisper"
 	    },
            providers = {
		-- secrets can be strings or tables with command and arguments
		-- secret = { "cat", "path_to/openai_api_key" },
		-- secret = { "bw", "get", "password", "OPENAI_API_KEY" },
		-- secret : "sk-...",
		-- secret = os.getenv("env_name.."),
		openai = {
			disable = true,
			endpoint = "https://api.openai.com/v1/chat/completions",
			-- secret = os.getenv("OPENAI_API_KEY"),
		},
		groq = {
      			endpoint = GROQ_HOST,
      			secret = GROQ_KEY,
    		},
		azure = {
			disable = true,
			endpoint = "https://$URL.openai.azure.com/openai/deployments/{{model}}/chat/completions",
			secret = os.getenv("AZURE_API_KEY"),
		},
		copilot = {
			disable = false,
			endpoint = "https://api.githubcopilot.com/chat/completions",
			secret = {
                        "powershell",
                        "-Command",
                        '(Get-Content $env:LOCALAPPDATA\\github-copilot\\apps.json -Raw | ConvertFrom-Json)."github.com:Iv1.b507a08c87ecfe98".oauth_token',
                    },

		},
		ollama = {
			disable = true,
			endpoint = "http://localhost:11434/v1/chat/completions",
			secret = "dummy_secret",
		},
		lmstudio = {
			disable = true,
			endpoint = "http://localhost:1234/v1/chat/completions",
			secret = "dummy_secret",
		},
		googleai = {
			disable = true,
			endpoint = "https://generativelanguage.googleapis.com/v1beta/models/{{model}}:streamGenerateContent?key={{secret}}",
			secret = os.getenv("GOOGLEAI_API_KEY"),
		},
		pplx = {
			disable = true,
			endpoint = "https://api.perplexity.ai/chat/completions",
			secret = os.getenv("PPLX_API_KEY"),
		},
		anthropic = {
			disable = true,
			endpoint = "https://api.anthropic.com/v1/messages",
			secret = os.getenv("ANTHROPIC_API_KEY"),
		},
	},
        }
        require("gp").setup(conf)

              -- Setup shortcuts here (see Usage > Shortcuts in the Documentation/Readme)
                    local function keymapOptions(desc)
                        return {
                            noremap = true,
                            silent = true,
                            nowait = true,
                            desc = "GPT: " .. desc
                        }
                    end

                    -- Keymaps for Gp.nvim
                    vim.keymap.set({"n", "i"}, "<leader>gt", "<cmd>GpChatToggle<cr>", keymapOptions("Toggle Chat"))
                    vim.keymap.set({"n", "i"}, "<leader>gc", "<cmd>GpChatNew<cr>", keymapOptions("New Chat"))
                    vim.keymap.set({"n", "i"}, "<leader>gr", "<cmd>GpRewrite<cr>", keymapOptions("Rewrite Response"))
                    vim.keymap.set({"n", "i"}, "<leader>gp", "<cmd>GpAppend<cr>", keymapOptions("Append (after)"))
                    --  vim.keymap.set({"n", "i"}, "<leader>gw", "<cmd>GpPrepend<cr>", keymapOptions("Prepend (before)"))
                    vim.keymap.set({"n", "i"}, "<leader>gf", "<cmd>GpChatFinder<cr>", keymapOptions("Chat Finder"))
                    -- Bind <leader>ga to :GpChatRespond
                    vim.keymap.set({"n", "i"}, "<leader>ga", "<cmd>GpChatRespond<cr>", keymapOptions("Chat Respond"))

                    -- Optional for Visual Mode
                    vim.keymap.set(
                        "v",
                        "<leader>gt",
                        ":<C-u>'<,'>GpChatToggle<cr>",
                        keymapOptions("Toggle Chat (Visual)")
                    )
                    vim.keymap.set("v", "<leader>gc", ":<C-u>'<,'>GpChatNew<cr>", keymapOptions("New Chat (Visual)"))

                    -- Define a function to open chat with the entire buffer as context in a popup
                    local BufferChatNewPopup = function()
                        -- Call GpChatNew in range mode with popup layout
                        vim.api.nvim_command("%GpChatNew popup")
                    end

                    vim.keymap.set(
                        {"n", "i"},
                        "<leader>gw",
                        "<cmd>GpWhisperRewrite<cr>",
                        keymapOptions("Whisper Inline Rewrite")
                    )

                    -- Keymap for BufferChatNewPopup
                    vim.keymap.set(
                        {"n", "i"},
                        "<leader>gh",
                        BufferChatNewPopup,
                        keymapOptions("Chat New with Full Buffer in Popup")
                    )

                    vim.keymap.set(
                        "v",
                        "<leader>gr",
                        ":<C-u>'<,'>GpRewrite<cr>",
                        keymapOptions("Rewrite Response (Visual)")
                    )
                    vim.keymap.set("v", "<leader>gp", ":<C-u>'<,'>GpAppend<cr>", keymapOptions("Append (Visual)"))
                    vim.keymap.set("v", "<leader>gw", ":<C-u>'<,'>GpPrepend<cr>", keymapOptions("Prepend (Visual)"))
                    vim.keymap.set(
                        "v",
                        "<leader>gf",
                        ":<C-u>'<,'>GpChatFinder<cr>",
                        keymapOptions("Chat Finder (Visual)")
                    )
    end,
})
[2025-02-09.16-17-39.905] [6e21da5b] DEBUG: whisper setup started
{
  cmd_prefix = "Gp",
  curl_params = {},
  endpoint = "https://api.groq.com/openai/v1/audio/transcriptions",
  model = "distil-whisper-large-v3-en",
  secret = "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",
  sox_args = { "-t", "waveaudio", "default", "--no-show-progress", "--rate", "16000", "--channels", "1", "--encoding", "signed-integer", "--bits", "16", "--endian", "little", "-" },
  sox_path = "D:\\Add on\\sox\\sox-14-4-1\\sox.exe",
  store_dir = "/tmp/gp_whisper",
  style_popup_border = "single"
}
[2025-02-09.16-17-39.906] [6e21da5b] DEBUG: resolved whisper store directory:
/tmp/gp_whisper -> /tmp/gp_whisper
[2025-02-09.16-17-39.906] [6e21da5b] DEBUG: creating user command: GpWhisper
[2025-02-09.16-17-39.906] [6e21da5b] DEBUG: whisper setup finished
[2025-02-09.16-17-39.907] [6e21da5b] DEBUG: resolved chat_dir directory:
C:\Users\Lenovo\AppData\Local\nvim-data/gp/chats -> C:\Users\Lenovo\AppData\Local\nvim-data/gp/chats
[2025-02-09.16-17-39.907] [6e21da5b] DEBUG: resolved state_dir directory:
C:\Users\Lenovo\AppData\Local\nvim-data/gp/persisted -> C:\Users\Lenovo\AppData\Local\nvim-data/gp/persisted
[2025-02-09.16-17-39.908] [6e21da5b] DEBUG: state[updated]: disk=1739092609 old=1739092609 new=1739092659
[2025-02-09.16-17-39.909] [6e21da5b] DEBUG: creating user command: GpInspectLog
[2025-02-09.16-17-39.909] [6e21da5b] DEBUG: creating user command: GpImplement
[2025-02-09.16-17-39.910] [6e21da5b] DEBUG: creating user command: GpInspectPlugin
[2025-02-09.16-17-39.910] [6e21da5b] DEBUG: creating user command: GpRewrite
[2025-02-09.16-17-39.910] [6e21da5b] DEBUG: creating user command: GpWhisperRewrite
[2025-02-09.16-17-39.911] [6e21da5b] DEBUG: creating user command: GpEnew
[2025-02-09.16-17-39.911] [6e21da5b] DEBUG: creating user command: GpWhisperEnew
[2025-02-09.16-17-39.912] [6e21da5b] DEBUG: creating user command: GpChatRespond
[2025-02-09.16-17-39.912] [6e21da5b] DEBUG: creating user command: GpWhisperPopup
[2025-02-09.16-17-39.912] [6e21da5b] DEBUG: creating user command: GpChatFinder
[2025-02-09.16-17-39.913] [6e21da5b] DEBUG: creating user command: GpWhisperAppend
[2025-02-09.16-17-39.913] [6e21da5b] DEBUG: creating user command: GpPrepend
[2025-02-09.16-17-39.913] [6e21da5b] DEBUG: creating user command: GpWhisperPrepend
[2025-02-09.16-17-39.914] [6e21da5b] DEBUG: creating user command: GpVnew
[2025-02-09.16-17-39.914] [6e21da5b] DEBUG: creating user command: GpWhisperVnew
[2025-02-09.16-17-39.914] [6e21da5b] DEBUG: creating user command: GpNextAgent
[2025-02-09.16-17-39.914] [6e21da5b] DEBUG: creating user command: GpChatDelete
[2025-02-09.16-17-39.915] [6e21da5b] DEBUG: creating user command: GpAppend
[2025-02-09.16-17-39.915] [6e21da5b] DEBUG: creating user command: GpPopup
[2025-02-09.16-17-39.915] [6e21da5b] DEBUG: creating user command: GpStop
[2025-02-09.16-17-39.915] [6e21da5b] DEBUG: creating user command: GpAgent
[2025-02-09.16-17-39.915] [6e21da5b] DEBUG: creating user command: GpChatNew
[2025-02-09.16-17-39.916] [6e21da5b] DEBUG: creating user command: GpChatPaste
[2025-02-09.16-17-39.916] [6e21da5b] DEBUG: creating user command: GpChatToggle
[2025-02-09.16-17-39.916] [6e21da5b] DEBUG: creating user command: GpNew
[2025-02-09.16-17-39.917] [6e21da5b] DEBUG: creating user command: GpWhisperNew
[2025-02-09.16-17-39.917] [6e21da5b] DEBUG: creating user command: GpContext
[2025-02-09.16-17-39.917] [6e21da5b] DEBUG: creating user command: GpTabnew
[2025-02-09.16-17-39.917] [6e21da5b] DEBUG: creating user command: GpWhisperTabnew
[2025-02-09.16-17-39.919] [6e21da5b] DEBUG: setup finished
[2025-02-09.16-17-43.790] [6e21da5b] DEBUG: [SENSITIVE DATA] REDACTED
[2025-02-09.16-17-43.797] [6e21da5b] DEBUG: [SENSITIVE DATA] REDACTED
[2025-02-09.16-17-43.801] [6e21da5b] DEBUG: registering shortcut: mode: { "n", "i", "v" } key: <esc> buffers: { 2 } callback: <function 1>
[2025-02-09.16-17-43.801] [6e21da5b] DEBUG: registering shortcut: mode: { "n", "i", "v" } key: <C-c> buffers: { 2 } callback: <function 1>
[2025-02-09.16-17-43.802] [6e21da5b] DEBUG: registering shortcut: mode: { "n", "i", "v" } key: <cr> buffers: { 2 } callback: <function 1>
[2025-02-09.16-17-43.824] [6e21da5b] DEBUG: [SENSITIVE DATA] REDACTED
[2025-02-09.16-17-43.831] [6e21da5b] DEBUG: [SENSITIVE DATA] REDACTED
[2025-02-09.16-17-49.500] [6e21da5b] ERROR: sox exited with code and signal:
code: 1, signal: 0
stdout: ""
stderr: "\r\nInput File     : 'default' (waveaudio)\r\nChannels       : 1\r\nSample Rate    : 48000\r\nPrecision      : 16-bit\r\nSample Encoding: 16-bit Signed Integer PCM\r\n\r\n\rIn:0.00% 00:00:00.00 [00:00:00.00] Out:0     [      |      ]        Clip:0    \rIn:0.00% 00:00:00.03 [00:00:00.00] Out:1.28k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.05 [00:00:00.00] Out:2.56k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.08 [00:00:00.00] Out:3.84k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.11 [00:00:00.00] Out:5.12k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.14 [00:00:00.00] Out:6.50k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.16 [00:00:00.00] Out:7.68k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.19 [00:00:00.00] Out:9.09k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.22 [00:00:00.00] Out:10.4k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.24 [00:00:00.00] Out:11.6k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.27 [00:00:00.00] Out:13.1k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.30 [00:00:00.00] Out:14.3k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.33 [00:00:00.00] Out:15.7k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.36 [00:00:00.00] Out:17.1k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.38 [00:00:00.00] Out:18.4k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.41 [00:00:00.00] Out:19.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.44 [00:00:00.00] Out:21.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.47 [00:00:00.00] Out:22.4k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.50 [00:00:00.00] Out:23.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.52 [00:00:00.00] Out:25.1k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.55 [00:00:00.00] Out:26.5k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.58 [00:00:00.00] Out:27.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.61 [00:00:00.00] Out:29.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.64 [00:00:00.00] Out:30.6k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.66 [00:00:00.00] Out:31.9k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.69 [00:00:00.00] Out:33.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.72 [00:00:00.00] Out:34.5k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.75 [00:00:00.00] Out:35.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.78 [00:00:00.00] Out:37.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.81 [00:00:00.00] Out:38.7k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.83 [00:00:00.00] Out:39.9k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.86 [00:00:00.00] Out:41.3k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.89 [00:00:00.00] Out:42.6k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.92 [00:00:00.00] Out:43.9k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.94 [00:00:00.00] Out:45.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:00.97 [00:00:00.00] Out:46.5k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.00 [00:00:00.00] Out:47.9k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.02 [00:00:00.00] Out:49.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.05 [00:00:00.00] Out:50.6k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.08 [00:00:00.00] Out:51.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.11 [00:00:00.00] Out:53.2k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.13 [00:00:00.00] Out:54.4k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.16 [00:00:00.00] Out:55.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.19 [00:00:00.00] Out:57.1k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.22 [00:00:00.00] Out:58.4k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.25 [00:00:00.00] Out:59.8k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.27 [00:00:00.00] Out:61.1k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.30 [00:00:00.00] Out:62.3k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.33 [00:00:00.00] Out:63.6k [      |      ]        Clip:0    \rIn:0.00% 00:00:01.35 [00:00:00.00] Out:64.9k [      |      ]        Clip:0"

I've checked sox installed with :checkhealth but still got no idea why this issue come up

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions