Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mmap | |
| import torch | |
| import json | |
| import os | |
| from huggingface_hub import hf_hub_download | |
| def load_file(filename, device): | |
| with open(filename, mode="r", encoding="utf8") as file_obj: | |
| with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CTC vanilla and CTC via crossentropy are equal, and their gradients as well. In this reformulation it's easier to experiment with modifications of CTC. | |
| # References on CTC regularization: | |
| # "A Novel Re-weighting Method for Connectionist Temporal Classification", Li et al, https://arxiv.org/abs/1904.10619 | |
| # "Focal CTC Loss for Chinese Optical Character Recognition on Unbalanced Datasets", Feng et al, https://www.hindawi.com/journals/complexity/2019/9345861/ | |
| # "Improved training for online end-to-end speech recognition systems", Kim et al, https://arxiv.org/abs/1711.02212 | |
| import torch | |
| import torch.nn.functional as F | |
| ## generate example data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #EXTM3U | |
| #EXTINF:0,France Culture - direct | |
| http://direct.franceculture.fr/live/franceculture-midfi.mp3 | |
| #EXTINF:0,France Inter | |
| http://icecast.radiofrance.fr/franceinter-hifi.aac?id=radiofrance | |
| #EXTINF:0,France Musique | |
| http://direct.francemusique.fr/live/francemusique-midfi.mp3 | |
| #EXTINF:0,France Info | |
| https://stream.radiofrance.fr/franceinfo/franceinfo_hifi.m3u8 | |
| #EXTINF:0,France Culture - alternative link |