Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crates/llama-sys/src/autocommit_common_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "arg.h"
#include "common.h"
#include "download.h"
#include "hf-cache.h"
#include "log.h"
#include "sampling.h"

Expand Down Expand Up @@ -154,8 +155,12 @@ static std::string resolve_hf_model(autocommit_common_config & cfg) {
common_download_task task(plan.primary, opts);
common_download_run_tasks({ task });

// After download, the final cached path is available
model.path = plan.primary.final_path.empty() ? plan.primary.local_path : plan.primary.final_path;
// finalize_file creates the HF-cache snapshot symlink
// (snapshots/<rev>/<file> -> ../../blobs/<sha>) and returns the path to use:
// the snapshot symlink, or the blob path itself if symlink creation fails.
// Without it the blob downloads but the resolved final_path dangles. Mirrors
// how llama.cpp's own common/arg.cpp finalizes downloaded models.
model.path = hf_cache::finalize_file(plan.primary);
return model.path;
}

Expand Down
Loading