Skip to content

Instantly share code, notes, and snippets.

View cerisara's full-sized avatar

Christophe Cerisara cerisara

  • LORIA - CNRS
  • Nancy, France
View GitHub Profile
@jacobeisenstein
jacobeisenstein / conference-travel-co2.ipynb
Last active April 8, 2024 10:03
conference travel co2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Narsil
Narsil / pure_torch.py
Created November 10, 2022 15:06
Loading a safetensors file with pure torch only
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:
@vadimkantorov
vadimkantorov / ctc_alignment_targets.py
Last active April 9, 2024 03:03
An implementation of CTC re-formulation via cross-entropy with pseudo-labels, following "A Novel Re-weighting Method for Connectionist Temporal Classification"
# 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
@Ezka77
Ezka77 / Radio.m3u
Last active February 24, 2024 00:23
RadioFrance m3u playlist
#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
@markusfisch
markusfisch / README.md
Last active January 21, 2023 15:15
Handy shell script that eases building and running Android apps from the command line with ant and adb

Handy Android shortcuts

This little script eases building, running, testing and analyzing Android apps with [ant][2] and [adb][1].

You may also see it as interactive dictionary of useful [adb commands][1].

How to use