Replies: 2 comments
-
A correction to my observations. The F16 vs F32 assert failure was proably because I introduced a new second parameter (the name of the refined model) so my extra parameter count triggered F32 logic (as if But after this fix (the source is available at the fork ) I see a segmenation fault error while executing main.exe as below and the
With the normal actions the line is usually Is it possible that in order to provide a different state_dict I should also provide the same base file that was used when this model was trained? I suspect that it's not necessary since as I posted before, the original whisper was ok with the modified dict. Also maybe some other tool exists in the project that might allow revealing what's wrong with the converted version of the bin file? |
Beta Was this translation helpful? Give feedback.
-
With a help of logging in The modified fragment that relies on the actual type from arrays is below. It should be compatible with the existing if use_f16:
print("dtype is:", data.dtype)
if n_dims < 2 or \
name == "encoder.conv1.bias" or \
name == "encoder.conv2.bias" or \
name == "encoder.positional_embedding" or \
name == "decoder.positional_embedding":
print(" Converting to float32")
data = data.astype(np.float32)
else:
print(" Converting to float16")
data = data.astype(np.float16)
if data.dtype == np.float16:
ftype = 1
else:
ftype = 0
else:
data = data.astype(np.float32)
ftype = 0 To compare, the original fragment is ftype = 1
if use_f16:
if n_dims < 2 or \
name == "encoder.conv1.bias" or \
name == "encoder.conv2.bias" or \
name == "encoder.positional_embedding" or \
name == "decoder.positional_embedding":
print(" Converting to float32")
data = data.astype(np.float32)
ftype = 0
else:
data = data.astype(np.float32)
ftype = 0
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a fine-tuned model (base-refined.pt) that can't be converted directly to ggml,
convert-pt-to-ggml.py
script complains about lacking ofdims
entry. As I saw from the example of usage, this model successfully works with the original whisper with the following stepsload_state_dict
is used to load the dict frombase-refined.pt
and an additional decoding test outputs a refined version of recognitionI tried to use
convert-pt-to-ggml.py
as the base and modify it. The first naive stepconverted the file, but inference complained about
unknown tensor 'model.encoder.positional_embedding'
even before "main processing", so after finding that the dict entries all prefixed withmodel.
. I changed this towhich moved the things further, but now "main processing" has started, but new error is
GGML_ASSERT: C:/msys64/home/{ }/whisper.cpp/ggml.c:13455: src0->type == GGML_TYPE_F16
Is there something obvious I'm missing here or additional information about this model file is needed ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions