Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversion scripts from HuggingFace models to CoreML #1304

Merged
merged 1 commit into from Oct 4, 2023

Conversation

AlienKevin
Copy link
Contributor

Intended to close issues #1296 and #947

Sample usage

  1. Download fine-tuned model from HuggingFace
git clone https://huggingface.co/Oblivion208/whisper-tiny-cantonese
  1. Convert fine-tuned model to GGML (git clone the openai/whisper repo if you haven't already)
python ./whisper.cpp/models/convert-h5-to-ggml.py ./whisper-tiny-cantonese ./whisper . 
  1. Copy the GGML model to models
cp ./ggml-model.bin ./whisper.cpp/models/ggml-tiny.bin
  1. Convert HuggingFace model to CoreML
./models/generate-coreml-model.sh -h5 tiny ../whisper-tiny-cantonese

Alternatively, let the script automatically download the model directly from HuggingFace Hub:

./models/generate-coreml-model.sh -h5 tiny Oblivion208/whisper-tiny-cantonese
  1. Run inference with CoreML (Run make with CoreML settings if you haven't already)
./main -m models/ggml-tiny.bin -f samples/jfk.wav

Since I'm using a Cantonese model in the example, the output is pretty messy but the steps should be correct.

@ggerganov ggerganov merged commit 91c0b23 into ggerganov:master Oct 4, 2023
35 checks passed
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
vonstring pushed a commit to vonstring/whisper.cpp that referenced this pull request Nov 7, 2023
landtanin pushed a commit to landtanin/whisper.cpp that referenced this pull request Dec 16, 2023
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.

None yet

2 participants