Skip to content

Instantly share code, notes, and snippets.

View ccgus's full-sized avatar

August "Gus" Mueller ccgus

View GitHub Profile
#import <Foundation/Foundation.h>
#import <dlfcn.h>
// clang main.m -framework Foundation
int main(int argc, const char * argv[]) {
@autoreleasepool {
dlopen("/System/Library/Frameworks/CoreGraphics.framework/Resources/BridgeSupport/CoreGraphics.dylib", RTLD_LAZY);
@ccgus
ccgus / quant.py
Created November 7, 2023 21:21
Making the Beby-Gan model quite a bit smaller.
# Before running this, setup a python venv for everything:
# python3 -m venv coremltools-venv
# source coremltools-venv/bin/activate
# pip install -U coremltools
import coremltools as ct
from coremltools.models.neural_network import quantization_utils
# load full precision model
model_fp32 = ct.models.MLModel('Beby-GANx4.mlmodel')