Skip to content

Instantly share code, notes, and snippets.

View timfel's full-sized avatar

Tim Felgentreff timfel

View GitHub Profile
-- Start copy from spec/lua.lua
local unpack = table.unpack or unpack
local funcdef = "([A-Za-z_][A-Za-z0-9_%.%:]*)%s*"
local decindent = {
['else'] = true, ['elseif'] = true, ['until'] = true, ['end'] = true}
local incindent = {
['else'] = true, ['elseif'] = true, ['for'] = true, ['do'] = true,
['if'] = true, ['repeat'] = true, ['while'] = true}
local function isfndef(str)
@timfel
timfel / enaml_like_benchmark.py
Created July 7, 2022 09:27
Benchmark support for matplotlib and kiwi hpy ports
# ------------------------------------------------------------------------------
# Copyright (c) 2019, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------------------------------------
"""Time updating an EditVariable in a set of constraints typical of enaml use.
"""
from collections import namedtuple
import os
import pprint
import re
import requests
import shutil
import subprocess
import tarfile
import traceback
import zipfile
import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
from datasets import load_dataset
device = "cuda:0"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model_id = "openai/whisper-large-v3"
@timfel
timfel / requirements.txt
Created June 1, 2024 12:10
tiptoi translations
openai-whisper
torch
transformers
numpy
soundfile
datasets
sentencepiece
sacremoses
#!/bin/bash
set -ex
DEVICE=/dev/sdb1
## If rdb is not supported by kernel, use loop device
# DEVICE=/dev/sdb
# offset=`sudo parted -s $DEVICE unit b p | grep -A1 Start | tail -1 | awk '{print $2}'` | cut -dB -f1
# sudo losetup -o $offset /dev/loop1 $DEVICE
# DEVICE=/dev/loop1