Skip to content

HF support multiple precision options#361

Merged
HenryNdubuaku merged 6 commits intomainfrom
hf_publish_precisions
Feb 17, 2026
Merged

HF support multiple precision options#361
HenryNdubuaku merged 6 commits intomainfrom
hf_publish_precisions

Conversation

@jakmro
Copy link
Copy Markdown
Collaborator

@jakmro jakmro commented Feb 16, 2026

No description provided.

@jakmro jakmro force-pushed the hf_publish_precisions branch from edb8fce to b5b3a22 Compare February 16, 2026 22:23
@HenryNdubuaku
Copy link
Copy Markdown
Collaborator

@jakmro is this ready?

@jakmro
Copy link
Copy Markdown
Collaborator Author

jakmro commented Feb 16, 2026

@HenryNdubuaku need a few more minutes to do final testing and will be ready to go

jakmro and others added 5 commits February 17, 2026 01:11
…nd streamline configuration handling

Signed-off-by: jakmro <[email protected]>
* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: HenryNdubuaku <[email protected]>
Signed-off-by: jakmro <[email protected]>
* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

* pauth

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Signed-off-by: jakmro <[email protected]>
Signed-off-by: jakmro <[email protected]>
Signed-off-by: jakmro <[email protected]>
@jakmro jakmro force-pushed the hf_publish_precisions branch from 3045a5d to 3b0cc78 Compare February 17, 2026 00:11
@jakmro jakmro marked this pull request as ready for review February 17, 2026 00:17
Copilot AI review requested due to automatic review settings February 17, 2026 00:17
@jakmro
Copy link
Copy Markdown
Collaborator Author

jakmro commented Feb 17, 2026

@HenryNdubuaku ready

Copy link
Copy Markdown
Contributor

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 pull request adds support for exporting models in multiple precision formats (INT4, INT8, FP16) simultaneously in the HuggingFace publishing workflow. It also modernizes the Silero-VAD model loading by replacing torch.hub.load() with a dedicated silero-vad package.

Changes:

  • Refactored model export to support multiple precisions per model instead of single precision
  • Changed CLI arguments from --precision and --bits to boolean flags --int4, --int8, --fp16
  • Updated GitHub Actions workflow to use JSON configuration with per-model precision settings
  • Replaced Silero-VAD loading from torch.hub with silero-vad package and removed torchaudio dependency

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
python/src/publish_to_hf.py Refactored export logic to iterate over multiple precisions, removed stage_model function, changed CLI arguments to boolean flags
python/src/converter.py Updated Silero-VAD loading to use load_silero_vad() from silero-vad package
python/src/cli.py Updated Silero-VAD loading and removed torchaudio import check
python/requirements.txt Added silero-vad==6.2.0, removed torchaudio==2.8.0
.github/workflows/publish_to_hf.yml Restructured to use JSON config for model-specific precision settings, updated bash script logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

except Exception:
print(f"Failed to export Apple weights for {precision}")

shutil.rmtree(exported)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The exported directory is being deleted at line 160 before the loop continues to the next precision. However, if export_model returns the same directory path for different precisions (which it likely does based on the get_weights_dir implementation), this will cause the export of subsequent precisions to fail because the directory was already deleted. The export directory should only be deleted once, after all precisions have been processed, or each precision should export to a unique directory.

Copilot uses AI. Check for mistakes.
@HenryNdubuaku HenryNdubuaku merged commit daa119a into main Feb 17, 2026
7 of 8 checks passed
ncylich pushed a commit that referenced this pull request Feb 24, 2026
* Refactor model export process to support multiple precision options and streamline configuration handling

Signed-off-by: jakmro <[email protected]>

* Add optional cloud key prompt for transcribe (#359)

* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: HenryNdubuaku <[email protected]>
Signed-off-by: jakmro <[email protected]>

* Cactus auth command (#360)

* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

* pauth

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Signed-off-by: jakmro <[email protected]>

* fix rate limiter

Signed-off-by: jakmro <[email protected]>

* remove torchaudio

Signed-off-by: jakmro <[email protected]>

---------

Signed-off-by: jakmro <[email protected]>
Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: rshemet <[email protected]>
Co-authored-by: HenryNdubuaku <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
cattermelon1234 pushed a commit to cattermelon1234/cactus that referenced this pull request Feb 28, 2026
* Refactor model export process to support multiple precision options and streamline configuration handling

Signed-off-by: jakmro <[email protected]>

* Add optional cloud key prompt for transcribe (cactus-compute#359)

* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: HenryNdubuaku <[email protected]>
Signed-off-by: jakmro <[email protected]>

* Cactus auth command (cactus-compute#360)

* Add optional cloud key prompt for transcribe

Prompts user for cloud API key on first run or whenever key is not set.
If provided, key is saved to ~/.cactus/config.json and exported as
CACTUS_CLOUD_API_KEY env var for C++ cloud code. If skipped, user is
prompted again on next run. Env var takes precedence over config file.

Signed-off-by: Roman Shemet <[email protected]>

* Structure code properly

Signed-off-by: HenryNdubuaku <[email protected]>

* More changes padded in

Signed-off-by: HenryNdubuaku <[email protected]>

* pauth

Signed-off-by: HenryNdubuaku <[email protected]>

---------

Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Signed-off-by: jakmro <[email protected]>

* fix rate limiter

Signed-off-by: jakmro <[email protected]>

* remove torchaudio

Signed-off-by: jakmro <[email protected]>

---------

Signed-off-by: jakmro <[email protected]>
Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: HenryNdubuaku <[email protected]>
Co-authored-by: rshemet <[email protected]>
Co-authored-by: HenryNdubuaku <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants