We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 601929f commit ba8ae3fCopy full SHA for ba8ae3f
models/convert-h5-to-ggml.py
@@ -82,7 +82,11 @@ def bytes_to_unicode():
82
83
encoder = json.load((dir_model / "vocab.json").open("r", encoding="utf8"))
84
encoder_added = json.load((dir_model / "added_tokens.json").open( "r", encoding="utf8"))
85
-hparams = json.load((dir_model / "config.json").open("r", encoding="utf8") )
+hparams = json.load((dir_model / "config.json").open("r", encoding="utf8"))
86
+
87
+# Add this block to handle missing 'max_length'
88
+if "max_length" not in hparams:
89
+ hparams["max_length"] = hparams.get("max_target_positions", 448)
90
91
model = WhisperForConditionalGeneration.from_pretrained(dir_model)
92
0 commit comments