【帖子标题】:Trained a 1.5B to write shell commands so I’d stop googling tar flags. Runs on a laptop CPU in ~1 sec.

【帖子标题】:训练了一个1.5B模型来写shell命令,这样我就不用再去谷歌搜tar参数了。在笔记本电脑CPU上运行大约1秒。

【帖子正文】: I’ve been googling “tar extract gz” for about ten years. and I finally did something about it.

【帖子正文】: 我谷歌搜索“tar extract gz”大概有十年了,终于做了点什么。

It started out as a research project and I ended up with a Fine-tuned Qwen2.5-Coder-1.5B on 125k natural-language/command pairs, merged and quantized to Q4_K_M. 941MB which runs through llama.cpp. On my laptop (i5-11320H, 4 threads): 31.9 tok/s, 0.59s median per query, 1.6GB RAM.

起初这是一个研究项目,最终我在12.5万个自然语言/命令对上微调了Qwen2.5-Coder-1.5B,合并并量化到Q4_K_M。941MB,通过llama.cpp运行。在我的笔记本电脑(i5-11320H,4线程)上:31.9 tok/s,每查询中位数0.59秒,1.6GB内存。

I benchmarked it and it scores 0.620 on InterCode-ALFA. Untuned Qwen2.5-Coder-7B gets 0.613, GPT-4o gets 0.73. Not frontier, but it’s roughly a 7B’s answer at a quarter the parameters on a CPU. Theres a 3B variant too that scores higher.

我对其进行了基准测试,在InterCode-ALFA上得分为0.620。未微调的Qwen2.5-Coder-7B得分为0.613,GPT-4o为0.73。虽然不算顶尖,但在CPU上以四分之一参数达到了约7B模型的效果。还有一个3B变体,得分更高。

There’s also few static safety checker, because it will absolutely write a command that wipes your root if you ask it to:

还有一些静态安全检查器,因为如果你让它写,它绝对会写出一个清除你根目录的命令:

I have published the weights:

huggingface.co/ThorOdinson246/nl2sh-1.5b-Q4_K_M

and Code:

github.com/ThorOdinson246/whatisit-nl2sh

. I posted few days ago in LocalLLM and it did well 300+ stars and so many good suggestions so I figured people here will be interested too.

我已经发布了权重:

huggingface.co/ThorOdinson246/nl2sh-1.5b-Q4_K_M

和代码:

github.com/ThorOdinson246/whatisit-nl2sh

。几天前我在LocalLLM上发布了,效果不错,获得了300多个星标和许多好建议,所以我想这里的人也会感兴趣。

Both Apache-2.0. If you want to poke holes in the method or you’ve got ideas, please comment or open a PR. A ⭐ helps if you find it useful.

两者都是Apache-2.0许可。如果你想对这个方法挑毛病或者有想法,请评论或打开一个PR。如果你觉得有用,一个⭐会有所帮助。

submitted by

/u/PicassoOnPause

[link]

[comments]

提交者

/u/PicassoOnPause

[链接]

[评论]