Add git, ffmpeg and ImageMagick command adapters for Qwen2.5 0.5B
Browse files- .gitattributes +3 -0
- README.md +91 -0
- ffmpeg.gguf +3 -0
- git.gguf +3 -0
- imagemagick.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ffmpeg.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
git.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
imagemagick.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-0.5B-Instruct
|
| 4 |
+
library_name: gguf
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- lora
|
| 9 |
+
- gguf
|
| 10 |
+
- llama.cpp
|
| 11 |
+
- wllama
|
| 12 |
+
- ffmpeg
|
| 13 |
+
- git
|
| 14 |
+
- imagemagick
|
| 15 |
+
- modelxare
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Command add-ons for Qwen2.5 0.5B
|
| 19 |
+
|
| 20 |
+
Three small LoRA adapters that turn a plain-language request into a command line, one tool each.
|
| 21 |
+
They run in the browser with [wllama](https://github.com/ngxson/wllama) or natively with llama.cpp,
|
| 22 |
+
on top of one shared base model, and are published as signed releases in
|
| 23 |
+
[modelXare](https://modelxare.com) by weXare.
|
| 24 |
+
|
| 25 |
+
| File | Tool | Example request | Answer |
|
| 26 |
+
|---|---|---|---|
|
| 27 |
+
| `git.gguf` | git | undo my last commit but keep the changes | `git reset HEAD~1` |
|
| 28 |
+
| `ffmpeg.gguf` | ffmpeg | extract the audio from talk.mp4 as an mp3 | `ffmpeg -i talk.mp4 -vn talk.mp3` |
|
| 29 |
+
| `imagemagick.gguf` | ImageMagick | make a 200px thumbnail of photo.jpg | `magick photo.jpg -thumbnail 200x output.jpg` |
|
| 30 |
+
|
| 31 |
+
Each file is 5.9 MB (f16, rank 8, 16 layers).
|
| 32 |
+
|
| 33 |
+
## Base model
|
| 34 |
+
|
| 35 |
+
They apply only to
|
| 36 |
+
[`qwen2.5-0.5b-instruct-q4_k_m.gguf`](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/blob/9217f5db79a29953eb74d5343926648285ec7e67/qwen2.5-0.5b-instruct-q4_k_m.gguf)
|
| 37 |
+
(491 MB, SHA-256 `74a4da8c9fdbcd15bd1f6d01d621410d31c6fc00986f5eb687824e7b93d7a9db`). One copy of the
|
| 38 |
+
base serves all three, and switching between them needs no reload.
|
| 39 |
+
|
| 40 |
+
## Prompt
|
| 41 |
+
|
| 42 |
+
Each adapter was trained with one fixed system prompt and the request as the user message, using the
|
| 43 |
+
base model's own chat template. Use the same system prompt; the modelXare releases carry it in their
|
| 44 |
+
`command-generation` operation. ffmpeg and ImageMagick answer `UNSUPPORTED` / `unsupported_request`
|
| 45 |
+
when the tool can't do what was asked.
|
| 46 |
+
|
| 47 |
+
```sh
|
| 48 |
+
llama-cli -m qwen2.5-0.5b-instruct-q4_k_m.gguf --lora git.gguf -cnv \
|
| 49 |
+
-sys "You are a Git command translator. Read the user's natural-language request and reply with ONLY the exact git CLI command(s) that fulfill it. Use a single line when one command is enough; use newlines for a short sequence. Do not wrap commands in markdown, quotes, or explanation."
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Training
|
| 53 |
+
|
| 54 |
+
LoRA (QLoRA on `mlx-community/Qwen2.5-0.5B-Instruct-4bit`) with mlx-lm: rank 8, 16 layers, learning
|
| 55 |
+
rate 1e-4, batch 4, completion-only loss, early stopping on validation loss. Converted to PEFT layout
|
| 56 |
+
and then to GGUF with llama.cpp's `convert_lora_to_gguf.py`.
|
| 57 |
+
|
| 58 |
+
| Adapter | Training rows | Best checkpoint (val loss) |
|
| 59 |
+
|---|---|---|
|
| 60 |
+
| git | 4,592 | 0.047 |
|
| 61 |
+
| ffmpeg | 2,504 | 0.169 (iter 300) |
|
| 62 |
+
| ImageMagick | 2,505 | 0.100 |
|
| 63 |
+
|
| 64 |
+
The git data comes from templates with slot pools and typing noise. The ffmpeg and ImageMagick data
|
| 65 |
+
was generated by a larger language model from a task description, then checked by script.
|
| 66 |
+
|
| 67 |
+
## Evaluation
|
| 68 |
+
|
| 69 |
+
211 held-out requests per tool, greedy decoding, through native llama.cpp (node-llama-cpp) with the
|
| 70 |
+
q4_K_M base. Many test rows give an output file name the request never mentioned, so the second
|
| 71 |
+
column also accepts a different output file name when the request names none.
|
| 72 |
+
|
| 73 |
+
| Adapter | Exact match | Exact match, any unnamed output name | Base model alone (exact) |
|
| 74 |
+
|---|---|---|---|
|
| 75 |
+
| git | 83% | 86% | 30% (first 60 rows) |
|
| 76 |
+
| ImageMagick | 65% | 80% | 2% (first 60 rows) |
|
| 77 |
+
| ffmpeg | 35% | 68% | 0% (first 60 rows) |
|
| 78 |
+
|
| 79 |
+
## Limits
|
| 80 |
+
|
| 81 |
+
- Commands are suggestions: read them before running them. They can be wrong, and some (`git reset
|
| 82 |
+
--hard`, `git push --force`, overwriting output files) destroy data.
|
| 83 |
+
- English requests only. One tool per adapter; requests that need several tools are out of scope.
|
| 84 |
+
- Unusual flags, filters and long multi-step requests are the weakest cases, ffmpeg most of all.
|
| 85 |
+
Known misses: "discard my changes to README.md" gave `git checkout -- . README.md` (which discards
|
| 86 |
+
every file's changes), and trimming or GIF requests often get the wrong ffmpeg flags.
|
| 87 |
+
- ImageMagick answers sometimes write over the input file (`magick photo.jpg -rotate 90 photo.jpg`).
|
| 88 |
+
|
| 89 |
+
## License
|
| 90 |
+
|
| 91 |
+
Apache-2.0, like the base model. Qwen2.5-0.5B-Instruct is by the Qwen Team, Alibaba Cloud.
|
ffmpeg.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0c7228a774056eb3a1f271c2c638dac1e0097aeeb3eb3571cb88a58adfea6f3
|
| 3 |
+
size 5881024
|
git.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e39e473423881387babe324d16bc64d7bbf89cac0fc97d3d60222f79e220c096
|
| 3 |
+
size 5881024
|
imagemagick.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd5c1aee93705e6be426e3a708457a5bb09c4ca719aac117a0d9a512e8d092a4
|
| 3 |
+
size 5881024
|