Skip to content

Commit f39f057

Browse files
committed
2.3.1 Minor Updates and Fixes
1 parent 163d161 commit f39f057

File tree

4 files changed

+78
-11
lines changed

4 files changed

+78
-11
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@ cd HuggingFaceModelDownloader
162162
go build -o hfdownloader ./cmd/hfdownloader
163163
```
164164

165+
### Option 4: Docker 🐳
166+
167+
```bash
168+
# Build the image
169+
docker build -t hfdownloader .
170+
171+
# Run CLI in container
172+
docker run --rm -v ./models:/data hfdownloader download TheBloke/Mistral-7B-GGUF -o /data
173+
174+
# Run web server
175+
docker run --rm -p 8080:8080 -v ./models:/data hfdownloader serve \
176+
--models-dir /data/Models \
177+
--datasets-dir /data/Datasets
178+
179+
# With HuggingFace token
180+
docker run --rm -e HF_TOKEN=hf_xxx -p 8080:8080 hfdownloader serve
181+
```
182+
165183
---
166184

167185
## 🌐 Web UI
@@ -188,7 +206,8 @@ hfdownloader serve \
188206
--port 3000 \
189207
--models-dir ./Models \
190208
--datasets-dir ./Datasets \
191-
--token hf_xxx
209+
--token hf_xxx \
210+
--endpoint https://hf-mirror.com # Optional: use mirror
192211
```
193212

194213
---
@@ -222,6 +241,12 @@ export HF_TOKEN=hf_xxxxx
222241
# Filter specific files (case-insensitive)
223242
hfdownloader download TheBloke/Mistral-7B-GGUF:q4_k_m,q5_k_m
224243

244+
# Exclude files by pattern
245+
hfdownloader download TheBloke/Mistral-7B-GGUF -E .md,fp16,onnx
246+
247+
# Combine filters and excludes
248+
hfdownloader download owner/repo -F q4_k_m,q5_k_m -E .md
249+
225250
# Organize filtered files into subdirs
226251
hfdownloader download TheBloke/Mistral-7B-GGUF:q4_0,q8_0 --append-filter-subdir
227252
# Result: ./Storage/Mistral-7B-GGUF/q4_0/file.gguf
@@ -235,6 +260,9 @@ hfdownloader download owner/repo -b v1.0
235260

236261
# Dry run (preview files)
237262
hfdownloader download owner/repo --dry-run --plan-format json
263+
264+
# Use HuggingFace mirror (e.g., for China)
265+
hfdownloader download owner/repo --endpoint https://hf-mirror.com
238266
```
239267

240268
### Flags Reference
@@ -258,6 +286,7 @@ hfdownloader download owner/repo --dry-run --plan-format json
258286
| `--dataset` | `false` | Treat as dataset |
259287
| `-b, --revision` | `main` | Branch, tag, or commit |
260288
| `-F, --filters` | - | Comma-separated LFS filters |
289+
| `-E, --exclude` | - | Comma-separated patterns to exclude |
261290

262291
</details>
263292

@@ -291,6 +320,7 @@ hfdownloader download owner/repo --dry-run --plan-format json
291320
|------|---------|-------------|
292321
| `-t, --token` | `$HF_TOKEN` | HuggingFace access token |
293322
| `--config` | `~/.config/hfdownloader.yaml` | Config file path |
323+
| `--endpoint` | `https://huggingface.co` | Custom HF endpoint (mirrors) |
294324

295325
</details>
296326

RELEASE_NOTES.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ docker run --rm -p 8080:8080 -v ./models:/data hfdownloader serve --models-dir /
5555
- Created `Dockerfile` with multi-stage build
5656
- Updated API to support `excludes` in download requests
5757
- Updated settings endpoint to include custom endpoint config
58+
- **Web UI:** Added "Exclude" input field to Model and Dataset download forms
59+
- **Web UI:** Updated version display to v2.3.1
60+
61+
---
62+
63+
## 🙏 Acknowledgments
64+
65+
Special thanks to the community members whose PRs inspired these features:
66+
67+
| Contributor | PR | Feature |
68+
|-------------|-----|---------|
69+
| **[@jeroenkroese](https://github.com/jeroenkroese)** | [#41](https://github.com/bodaay/HuggingFaceModelDownloader/pull/41) | Exclude file patterns |
70+
| **[@windtail](https://github.com/windtail)** | [#38](https://github.com/bodaay/HuggingFaceModelDownloader/pull/38) | Custom HuggingFace endpoint |
71+
| **[@cdeving](https://github.com/cdeving)** | [#50](https://github.com/bodaay/HuggingFaceModelDownloader/pull/50) | Docker support |
72+
73+
Also thanks to the community for bug reports and PRs that helped identify issues in v2.3.0:
74+
- URL escaping fix (related to #60)
75+
- TUI speed improvements (related to #59)
76+
- API 400 fixes (related to #58)
5877

5978
---
6079

@@ -196,15 +215,6 @@ go build -o hfdownloader ./cmd/hfdownloader
196215

197216
---
198217

199-
## 🙏 Acknowledgments
200-
201-
Thanks to the community for bug reports and PRs that helped identify issues:
202-
- URL escaping fix (related to #60)
203-
- TUI speed improvements (related to #59)
204-
- API 400 fixes (related to #58)
205-
206-
---
207-
208218
## 📋 Full Changelog
209219

210220
**New Files:**

internal/assets/static/index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<span class="status-dot"></span>
7979
<span class="status-text">Connecting...</span>
8080
</div>
81-
<div class="version">v2.3.0</div>
81+
<div class="version">v2.3.1</div>
8282
</div>
8383
</nav>
8484

@@ -197,6 +197,17 @@ <h1>Download Model</h1>
197197
<span class="input-hint">Comma-separated. Only downloads LFS files matching these patterns (e.g., quantizations).</span>
198198
</div>
199199

200+
<div class="form-group">
201+
<label for="modelExcludesInput">Exclude (optional)</label>
202+
<input
203+
type="text"
204+
id="modelExcludesInput"
205+
name="excludes"
206+
placeholder=".md, fp16, onnx"
207+
>
208+
<span class="input-hint">Comma-separated. Skip files matching these patterns.</span>
209+
</div>
210+
200211
<div class="form-group">
201212
<label class="checkbox-label">
202213
<input type="checkbox" id="modelFilterSubdirCheck" name="appendFilterSubdir">
@@ -280,6 +291,17 @@ <h1>Download Dataset</h1>
280291
<span class="input-hint">Comma-separated. Filter LFS files by name pattern.</span>
281292
</div>
282293

294+
<div class="form-group">
295+
<label for="datasetExcludesInput">Exclude (optional)</label>
296+
<input
297+
type="text"
298+
id="datasetExcludesInput"
299+
name="excludes"
300+
placeholder=".md, .txt, raw"
301+
>
302+
<span class="input-hint">Comma-separated. Skip files matching these patterns.</span>
303+
</div>
304+
283305
<div class="form-actions">
284306
<button type="button" class="btn btn-ghost btn-preview" data-form="datasetForm">
285307
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">

internal/assets/static/js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,11 @@
845845
formData.forEach((value, key) => {
846846
if (key === 'dataset' || key === 'appendFilterSubdir') {
847847
obj[key] = true;
848+
} else if (key === 'filters' || key === 'excludes') {
849+
// Convert comma-separated string to array
850+
if (value && value.trim()) {
851+
obj[key] = value.split(',').map(s => s.trim()).filter(s => s);
852+
}
848853
} else if (value) {
849854
obj[key] = value;
850855
}

0 commit comments

Comments
 (0)