Add precision parameter to download_from_hf#362
Conversation
Signed-off-by: jakmro <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR adds a precision parameter to the download_from_hf function to enable downloading pre-converted models with specific quantization precision (INT4, INT8, or FP16) from the Cactus-Compute HuggingFace organization. The PR also includes organization name capitalization fixes and a refactoring of the cmd_test function to simplify model downloading logic.
Changes:
- Added precision parameter to
download_from_hffunction to construct precision-specific zip filenames - Updated organization name from "cactus-compute" to "Cactus-Compute" across docstrings and help text
- Refactored
cmd_testfunction to simplify model downloading with a more concise loop structure
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if getattr(args, 'reconvert', False): | ||
| for model_id in [ | ||
| getattr(args, 'model', 'LiquidAI/LFM2-VL-450M'), | ||
| getattr(args, 'transcribe_model', 'UsefulSensors/moonshine-base'), | ||
| getattr(args, 'vad_model', 'snakers4/silero-vad') | ||
| ]: | ||
| class DownloadArgs: | ||
| pass | ||
| dl_args = DownloadArgs() | ||
| dl_args.model_id = model_id | ||
| dl_args.reconvert = True | ||
| if args.precision: | ||
| dl_args.precision = args.precision | ||
| if args.token: | ||
| dl_args.token = args.token | ||
|
|
||
| if cmd_download(dl_args) != 0: | ||
| return 1 |
There was a problem hiding this comment.
Potential behavior change: The old code would reconvert models when either precision OR reconvert flags were set (line 863 in old code: 'if precision or reconvert'). The new code only reconverts when the reconvert flag is set. This means that specifying --precision alone will no longer trigger model reconversion. If this behavior change is intentional, consider documenting it. If not, the condition should be 'if getattr(args, 'reconvert', False) or getattr(args, 'precision', None):'.
Signed-off-by: jakmro <[email protected]>
Signed-off-by: jakmro <[email protected]>
No description provided.