Replies: 2 comments 4 replies
-
u can do it yourself, not too much difficultsimple codeconvert to SafeTensors: import whisper
import safetensors.torch
model = whisper.load_model("large")
safetensors.torch.save_model(model, "large.safetensors") load from SafeTensors: import whisper
import safetensors.torch
model = whisper.model.Whisper(whisper.model.ModelDimensions(
n_mels = 80,
n_vocab = 51865,
n_audio_ctx = 1500,
n_audio_state = 1280,
n_audio_head = 20,
n_audio_layer = 32,
n_text_ctx = 448,
n_text_state = 1280,
n_text_head = 20,
n_text_layer = 32
))
# model.to("cuda")
safetensors.torch.load_model(model, "large.safetensors")
model.set_alignment_heads(b"ABzY8zd+h!0{>%R7=D0pU<_bnWW*tkYAhobTNnu$jnkEkXqp)j;w1Tzk)UH3X%SZd&fFZ2fC2yj")
# model.transcribe(...) models infovalue for alignment heads can be found in https://github.com/openai/whisper/blob/main/whisper/__init__.py _ALIGNMENT_HEADS = {
"tiny.en" : b"ABzY8J1N>@0{>%R00Bk>$p{7v037`oCl~+#00",
"tiny" : b"ABzY8bu8Lr0{>%RKn9Fp%m@SkK7Kt=7ytkO",
"base.en" : b"ABzY8;40c<0{>%RzzG;p*o+Vo09|#PsxSZm00",
"base" : b"ABzY8KQ!870{>%RzyTQH3`Q^yNP!>##QT-<FaQ7m",
"small.en" : b"ABzY8>?_)10{>%RpeA61k&I|OI3I$65C{;;pbCHh0B{qLQ;+}v00",
"small" : b"ABzY8DmU6=0{>%Rpa?J`kvJ6qF(V^F86#Xh7JUGMK}P<N0000",
"medium.en": b"ABzY8usPae0{>%R7<zz_OvQ{)4kMa0BMw6u5rT}kRKX;$NfYBv00*Hl@qhsU00",
"medium" : b"ABzY8B0Jh+0{>%R7}kK1fFL7w6%<-Pf*t^=N)Qr&0RR9",
"large-v1" : b"ABzY8r9j$a0{>%R7#4sLmoOs{s)o3~84-RPdcFk!JR<kSfC2yj",
"large-v2" : b"ABzY8zd+h!0{>%R7=D0pU<_bnWW*tkYAhobTNnu$jnkEkXqp)j;w1Tzk)UH3X%SZd&fFZ2fC2yj",
"large" : b"ABzY8zd+h!0{>%R7=D0pU<_bnWW*tkYAhobTNnu$jnkEkXqp)j;w1Tzk)UH3X%SZd&fFZ2fC2yj",
} value for dimensions can be found using here the values:
|
Beta Was this translation helpful? Give feedback.
4 replies
-
huggingface also created safetensor version of whisper, but to be used with their pipeline interface |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We are currently utilizing models in our project stored in pickle format. However, after exploring the advantages of SafeTensors in terms of improved security we believe that it will provide us with an extra layer of security and protection against potential vulnerabilities.
model link: base, base.en
We wish to inquire about the plans or timeline, if any, regarding the update of models from pickle to SafeTensors:
Beta Was this translation helpful? Give feedback.
All reactions