mlboydaisuke commited on
Commit
c8d735f
·
verified ·
1 Parent(s): 388f000

Add model card

Browse files
Files changed (1) hide show
  1. README.md +88 -0
README.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: coreml
4
+ pipeline_tag: audio-to-audio
5
+ tags:
6
+ - coreml
7
+ - core-ml
8
+ - ios
9
+ - macos
10
+ - apple
11
+ - on-device
12
+ - voice-conversion
13
+ - voice-cloning
14
+ - arxiv:2312.01479
15
+ ---
16
+
17
+ # OpenVoice V2 — Core ML
18
+
19
+ *Voice Cloning*
20
+
21
+ Zero-shot voice conversion. Clone a speaker from ~10s reference audio.
22
+
23
+ Core ML conversion of [myshell-ai/OpenVoice](https://github.com/myshell-ai/OpenVoice) for on-device inference on iPhone, iPad and Mac. Converted with `coremltools`; the packages are stateless, so all sequencing and buffering lives in your Swift code.
24
+
25
+ | | |
26
+ |---|---|
27
+ | Task | audio to audio |
28
+ | Upstream | [myshell-ai/OpenVoice](https://github.com/myshell-ai/OpenVoice) |
29
+ | Packages | 2 |
30
+ | Download size | 58 MB |
31
+ | Minimum iOS | 17.0 |
32
+ | Peak RAM | ~500 MB |
33
+
34
+ ## Files
35
+
36
+ | File | Size | Compute units | SHA-256 |
37
+ |---|---:|---|---|
38
+ | `OpenVoice_SpeakerEncoder.mlpackage.zip` | 1 MB | `cpuAndGPU` | `c3f2a96aaf5ecb5c…` |
39
+ | `OpenVoice_VoiceConverter.mlpackage.zip` | 57 MB | `cpuAndGPU` | `ef3ce8a2d1564aef…` |
40
+ | **Total** | **58 MB** | | |
41
+
42
+ `compute_units` is not a suggestion -- it is the configuration the conversion was verified against. Moving a package to a different compute unit can silently change the numerics (FP16 attention overflow) or crash on the GPU.
43
+
44
+ ## Download
45
+
46
+ ```bash
47
+ hf download mlboydaisuke/coreml-zoo --include "openvoice/*" --local-dir ./openvoice
48
+ unzip './openvoice/openvoice/*.zip' -d ./openvoice
49
+ ```
50
+
51
+ ## Use in Swift
52
+
53
+ ```swift
54
+ import CoreML
55
+
56
+ let config = MLModelConfiguration()
57
+ config.computeUnits = .cpuAndGPU // as converted — see the table above
58
+
59
+ // Unzip the .mlpackage, drop it into your Xcode target and Xcode compiles it
60
+ // at build time:
61
+ let model = try OpenVoice_SpeakerEncoder(configuration: config)
62
+
63
+ // ...or compile a downloaded .mlpackage at runtime:
64
+ let compiled = try await MLModel.compileModel(at: mlpackageURL)
65
+ let model = try MLModel(contentsOf: compiled, configuration: config)
66
+ ```
67
+
68
+ > This model is split into 2 Core ML packages that are driven in sequence from Swift. Load them one at a time, copy the outputs out of the `MLMultiArray` buffers and release each model before loading the next — two large Core ML models resident at once will OOM on an iPhone.
69
+
70
+ ## Demo
71
+
72
+ - **Sample app** — [`sample_apps/OpenVoiceDemo`](https://github.com/john-rocky/CoreML-Models/tree/master/sample_apps/OpenVoiceDemo), a standalone SwiftUI project.
73
+ - **Models Zoo** — this model is downloadable and runnable inside the [Models Zoo app](https://apps.apple.com/app/id6762083207) on the App Store, no build required.
74
+
75
+ ## Conversion
76
+
77
+ - Script: [`convert_openvoice.py`](https://github.com/john-rocky/CoreML-Models/blob/master/conversion_scripts/convert_openvoice.py)
78
+ - Pitfalls hit during conversion (FP16 overflow, ANE buffer limits, stride handling): [`docs/coreml_conversion_notes.md`](https://github.com/john-rocky/CoreML-Models/blob/master/docs/coreml_conversion_notes.md)
79
+ - Model index: [CoreML-Models](https://github.com/john-rocky/CoreML-Models)
80
+
81
+ ## License
82
+
83
+ The conversion inherits the upstream license: **MIT**.
84
+
85
+ ## Credits
86
+
87
+ - Upstream authors: [myshell-ai/OpenVoice](https://github.com/myshell-ai/OpenVoice), 2023
88
+ - Core ML conversion: john-rocky (Daisuke Majima)