nyadla-sys / whisper.tflite

Optimized OpenAI's Whisper TFLite Port for Efficient Offline Inference on Edge Devices
MIT License
126 stars 26 forks source link

Magic numbers in Android Java Impl and Jupyter Notebook do not match #24

Open Geosearchef opened 8 months ago

Geosearchef commented 8 months ago

The file generated by your ipython notebook writes a magic number of:

fout.write(struct.pack("i", 0x74666C74))

The Android Java implementation checks for the presence of 0x5553454e, which is also what is present in the file in the models directory. https://github.com/nyadla-sys/whisper.tflite/blob/a7c02fdb52b06023da010063c9033152c3f84a77/whisper_android/app/src/main/java/com/whispertflite/utils/WhisperUtil.java#L82

vilassn commented 8 months ago

Magic number can be any four character string like "ABCD". It can be changed to your favourite string. But, need to check same string while loading vocab for validation.