mlx-audio icon indicating copy to clipboard operation
mlx-audio copied to clipboard

Add Option to Download Weights Remotely in Swift TTS

Open rudrankriyam opened this issue 6 months ago • 4 comments

For a better developer experience, we can add swift-transformers package to remotely download the weights with theirHub api to download model weights from Hugging Face Hub as an option API apart from having it locally.

I have done a implementation here: https://github.com/mlalma/kokoro-ios/pull/10

This can be done for Orpheus implementation as well.

Discussion with @Blaizzy: We only need 3 files from the package. Should we directly copy them or bloat the app with the package? Maybe that package will help further for more advanced download options

rudrankriyam avatar Aug 25 '25 07:08 rudrankriyam

Nice!

Discussion with @Blaizzy: We only need 3 files from the package. Should we directly copy them or bloat the app with the package? Maybe that package will help further for more advanced download options

I'm inclined to have them pulled in to reduce the dependency surface area (I realize this is an uphill battle 😅) if the license allows it, unless we expect the original implementation to be changing frequently and updating the code would be a chore.

lucasnewman avatar Aug 25 '25 16:08 lucasnewman

I'm inclined to have them pulled in to reduce the dependency surface area

Agreed. The package itself barely adds marginal time to the build as well, though. I doubt the HuggingFace API to fetch models will fetch anytime soon. I am not sure on the license of Apache 2.0, will have to add the notice to each file

rudrankriyam avatar Aug 25 '25 17:08 rudrankriyam

I'm inclined to have them pulled in to reduce the dependency surface area

Agreed. The package itself barely adds marginal time to the build as well, though. I doubt the HuggingFace API to fetch models will fetch anytime soon. I am not sure on the license of Apache 2.0, will have to add the notice to each file

FWIW I was looking at MLX Swift again recently and it might be easier to just pull this in -- it's pretty small and has minimal dependencies that will get pulled in anyway if we reference MLXLLM on Swift.

lucasnewman avatar Aug 27 '25 15:08 lucasnewman

FWIW I was looking at MLX Swift again recently and it might be easier to just pull this in -- it's pretty small and has minimal dependencies that will get pulled in anyway if we reference MLXLLM on Swift.

Agreed!

Blaizzy avatar Sep 01 '25 17:09 Blaizzy