Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

MUCZ
Copy link

@MUCZ MUCZ commented Jun 21, 2025

  • Updated the VAD model download path to use names starting with the ggml prefix (currently the shell script downloads models this way, but the Python script wasn't updated — this MR unifies the path naming).

  • Updated the model path in the VAD usage section of the README accordingly.

@MUCZ MUCZ changed the title Align VAD Model Path Naming with ggml Prefix and Update README chore: align VAD model path naming with ggml prefix and update readme.md Jun 21, 2025

base, ext = os.path.splitext(output_path)
output_file = f"{base}-v{silero_version}-ggml{ext}"
output_file = f"ggml-{base}-v{silero_version}{ext}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the ggml prefix should come before the file name and not before the path to the models directory:

Suggested change
output_file = f"ggml-{base}-v{silero_version}{ext}"
output_file = f"{base}ggml-v{silero_version}{ext}"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should perhaps change this to have a default value for the --output parameter, and then just allow it to be overridden by anything that the user wants. I'm not sure why I did not do that at the time.
Something like:

diff --git a/models/convert-silero-vad-to-ggml.py b/models/convert-silero-vad-to-ggml.py
index 9d3afd4c..b9fb549e 100644
--- a/models/convert-silero-vad-to-ggml.py
+++ b/models/convert-silero-vad-to-ggml.py
@@ -19,16 +19,15 @@ def convert_silero_vad(output_path, print_tensors=True):
                 clean_key = "_model." + key
             cleaned_dict[clean_key] = value
 
-    base, ext = os.path.splitext(output_path)
-    output_file = f"ggml-{base}-v{silero_version}{ext}"
-    print(f"Saving GGML Silero-VAD model to {output_file}")
+    print(f"Saving GGML Silero-VAD model to {output_path}")
 
     print("\nTensor info for debugging:")
     for key, tensor in cleaned_dict.items():
         print(f"  - {key}: {tensor.shape} ({tensor.dtype})")
     print()
 
-    with open(output_file, "wb") as fout:
+    print(f"output_file: {output_path}")
+    with open(output_path, "wb") as fout:
         # Write magic and version
         fout.write(struct.pack("i", 0x67676d6c))
 
@@ -184,12 +183,12 @@ def convert_silero_vad(output_path, print_tensors=True):
 
             print(f"  Wrote {data.size * (2 if ftype==1 else 4)} bytes")
 
-    print(f"\nDone! Model has been converted to GGML format: {output_file}")
-    print(f"File size: {os.path.getsize(output_file)} bytes")
+    print(f"\nDone! Model has been converted to GGML format: {output_path}")
+    print(f"File size: {os.path.getsize(output_path)} bytes")
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description="Convert Silero-VAD PyTorch model to GGML format")
-    parser.add_argument("--output", type=str, required=True, help="Path to output GGML model file")
+    parser.add_argument("--output", type=str, default=f"models/ggml-v{silero_version}.bin", help="Path to output GGML model file")
     parser.add_argument("--print-tensors", action="store_true", help="Print tensor values", default=True)
     args = parser.parse_args()

This would allow the conversion to be run as:

(venv) $ python models/convert-silero-vad-to-ggml.py
Saving GGML Silero-VAD model to models/ggml-v5.1.2.bin
...

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.