post_process_dispatcher.py 552 Bytes
Newer Older
mayp777's avatar
UPDATE  
mayp777 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Replaces every instance of 'torchaudio._backend' with 'torchaudio' in torchaudio.html.
Temporary hack while we maintain both the existing set of info/load/save functions and the
new ones backed by the backend dispatcher in torchaudio._backend.
"""
import sys

if __name__ == "__main__":
    build_dir = sys.argv[1]
    filepath = f"{build_dir}/html/torchaudio.html"

    with open(filepath, "r") as f:
        text = f.read()
        text = text.replace("torchaudio._backend", "torchaudio")

    with open(filepath, "w") as f:
        f.write(text)