1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #24] Add possibility to load model from local path #11

Closed
opened 2026-11-01 04:16:30 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @fengwang on GitHub (Nov 19, 2025).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/24

When running in a Docker container, Heretic currently downloads the model from HuggingFace even after binding the cache directory. Would it be possible to modify the behavior so Heretic prioritizes a local model folder if specified via the model parameter? If the parameter points to a local directory, the model should be loaded from there; otherwise, it should proceed as before downloading from HuggingFace.

Originally created by @fengwang on GitHub (Nov 19, 2025). Original GitHub issue: https://github.com/p-e-w/heretic/issues/24 When running in a Docker container, Heretic currently downloads the model from HuggingFace even after binding the cache directory. Would it be possible to modify the behavior so Heretic prioritizes a local model folder if specified via the model parameter? If the parameter points to a local directory, the model should be loaded from there; otherwise, it should proceed as before downloading from HuggingFace.
Author
Owner

@spikymoth commented on GitHub (Nov 19, 2025):

Looks like you can pass in an absolute path like /home/user/models/Qwen/Qwen3-4B-Instruct-2507 and it'll work. The same goes for the datasets.

Note that relative paths don't seem to work, at least for the model - the transformers library will throw a validation error.

<!-- gh-comment-id:3552951225 --> @spikymoth commented on GitHub (Nov 19, 2025): Looks like you can pass in an absolute path like `/home/user/models/Qwen/Qwen3-4B-Instruct-2507` and it'll work. The same goes for the datasets. Note that relative paths *don't* seem to work, at least for the model - the transformers library will throw a validation error.
Author
Owner

@fengwang commented on GitHub (Nov 19, 2025):

Have you tried yet? I thought we have to use the local_files_only flag, with more modification like this: github.com/fengwang/heretic@b4949bc07f

<!-- gh-comment-id:3553703966 --> @fengwang commented on GitHub (Nov 19, 2025): Have you tried yet? I thought we have to use the `local_files_only` flag, with more modification like this: https://github.com/fengwang/heretic/commit/b4949bc07f6b7955663a57420b325e94c9e82bf9
Author
Owner

@spikymoth commented on GitHub (Nov 19, 2025):

Yes, I've tried it and it works. The underlying APIs accept both repository links and paths; if you pass in a path that starts with a slash then it'll use the local directory instead of trying to access a repo.

<!-- gh-comment-id:3553838000 --> @spikymoth commented on GitHub (Nov 19, 2025): Yes, I've tried it and it works. The underlying APIs accept both repository links and paths; if you pass in a path that starts with a slash then it'll use the local directory instead of trying to access a repo.
Author
Owner

@fengwang commented on GitHub (Nov 19, 2025):

Yes, I've tried it and it works. The underlying APIs accept both repository links and paths; if you pass in a path that starts with a slash then it'll use the local directory instead of trying to access a repo.

Many thanks. I will close this issue then.

<!-- gh-comment-id:3553963121 --> @fengwang commented on GitHub (Nov 19, 2025): > Yes, I've tried it and it works. The underlying APIs accept both repository links and paths; if you pass in a path that starts with a slash then it'll use the local directory instead of trying to access a repo. Many thanks. I will close this issue then.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#11
No description provided.