Navigation Menu

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
@cerisara
cerisara / pure_torch.py
Created February 16, 2024 12:26 — forked from Narsil/pure_torch.py
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:
@cerisara
cerisara / gitolab.php
Created August 31, 2016 09:13 — forked from benoitzohar/gitolab.php
Migrate repositories from Gitolite to GitLab.
#!/usr/bin/php -qC
<?php
/******************************************************************************
*
* @file gitolab.php
* @author Benoit Zohar
* @link http://benoitzohar.fr/
* @last-edited 2015-01-09
* @description Migrate projects from Gitolite to GitLab