huggingface / llm.nvim

LLM powered development for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query fail when reading token from file contain newline char

cifvts opened this issue · comments

https://github.com/huggingface/hfcc.nvim/blob/214def02936d4f76c82c2db28325ef3fdefb2e4f/lua/hfcc/config.lua#L37

If the token is read from $HF_HOME/token, the config might read also the ned of line character, that will cause the curl query to fail.
A possible solution to the issue:

api_token = string.gsub(f:read("*a"), "[\n\r]", "")

Hi @cifvts, thanks for reporting this bug. Could you submit a PR with the fix?