Skip to content

Conversation

zwpaper
Copy link
Member

@zwpaper zwpaper commented Jun 30, 2025

…l has multiple gguf partitions

fix #4298

CleanShot 2025-06-30 at 18 17 49@2x

@zwpaper zwpaper requested a review from Copilot June 30, 2025 10:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with the local model filename resolution when handling models with multiple gguf partitions. The changes include:

  • Adding an import for fs to support file system operations.
  • Modifying resolve_model_path to use a new helper function get_model_entry_path.
  • Introducing get_model_entry_path to locate the model entry file based on a specified prefix.

// will look for the file with the prefix "00001-of-"
pub fn get_model_entry_path(path: &PathBuf) -> Option<PathBuf> {
for entry in fs::read_dir(path).ok()? {
let entry = entry.expect("Error reading directory entry");
Copy link
Preview

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using expect here may cause a panic if directory entry reading fails. Consider handling the error gracefully (e.g., by propagating the error or logging it) to prevent unexpected crashes.

Suggested change
let entry = entry.expect("Error reading directory entry");
let entry = entry.ok()?; // Propagate error gracefully

Copilot uses AI. Check for mistakes.

@wsxiaoys wsxiaoys enabled auto-merge (squash) June 30, 2025 10:24
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 55.33%. Comparing base (08091cc) to head (ddb4498).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
crates/llama-cpp-server/src/lib.rs 0.00% 20 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4302      +/-   ##
==========================================
- Coverage   55.37%   55.33%   -0.04%     
==========================================
  Files         238      238              
  Lines       30276    30294      +18     
==========================================
  Hits        16764    16764              
- Misses      13512    13530      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wsxiaoys wsxiaoys merged commit 502b9c0 into main Jun 30, 2025
5 of 8 checks passed
@wsxiaoys wsxiaoys deleted the fix/local-multiparts branch June 30, 2025 10:33
zwpaper added a commit that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to load multi-model ggml files
2 participants