config --set: suggest similar configs when no exact match found (fixes #239)#242
Open
stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
Open
config --set: suggest similar configs when no exact match found (fixes #239)#242stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
Conversation
When 'nbfc config --set <MODEL>' fails to find an exact match, compute Levenshtein-based similarity scores against all available configs and print any that meet the RecommendedConfigMatchThreshold (0.7). If no close match exists, point the user to 'nbfc config --list'. Fixes nbfc-linux#239
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user runs
nbfc config --set "Thinkpad L540"but the actual config name isLenovo Thinkpad L540, the command fails with a bare error message:There is no guidance on what the correct name might be or how to find it.
Fix
When an exact match is not found, compute Levenshtein-based similarity scores (reusing the existing
str_similarityfunction) against all available configs and print any that meet theRecommendedConfigMatchThreshold(0.7):If no close match exists, the user is pointed to
nbfc config --list:No new dependencies — reuses
str_similarity,ConfigFile_CompareByDiff, andRecommendedConfigMatchThresholdalready present in the codebase.Closes #239