Skip to content

Instantly share code, notes, and snippets.

@madebyollin
madebyollin / README.md
Last active April 2, 2024 13:50 — forked from mrsteyk/README.md
dalle_runner_api.model_infra.modules.public_diff_vae
@pommedeterresautee
pommedeterresautee / Makefile
Last active January 21, 2023 17:36
Divide Hugging Face Transformers training times by 2 or more with dynamic padding and uniform length batching
# required by (\ SHELL COMMANDS \)
SHELL:=/bin/bash
VIRT_ENV_FOLDER = ~/.local/share/virtualenvs/xnli
SOURCE_VIRT_ENV = source $(VIRT_ENV_FOLDER)/bin/activate
.PHONY: train
train:
( \
@roman-ku
roman-ku / flask_unveil_server.py
Created January 1, 2019 01:56 — forked from peterkuma/server.py
A flask server for serving all JPEG images in a local directory and subdirectories. Uses unveil.js for lazy-loading of images. Thumbnails are created on the fly by PIL.
# you also need to download this file: https://github.com/luis-almeida/unveil/blob/master/jquery.unveil.js
# and place it in the same directory as this python file with the name "jquery.unveil.js"
import os
from io import BytesIO
from flask import Flask, Response, request, abort, render_template_string, send_from_directory
from PIL import Image
@miku
miku / withsqlite.py
Last active November 30, 2022 20:31
Simple sqlite3 context manager for Python.
#!/usr/bin/env python
import sqlite3
class dbopen(object):
"""
Simple CM for sqlite3 databases. Commits everything at exit.
"""
def __init__(self, path):
self.path = path