Skip to content

Instantly share code, notes, and snippets.

View ngaloppo's full-sized avatar

Nico Galoppo ngaloppo

View GitHub Profile
@sayakpaul
sayakpaul / inference_with_torchao_serialized.py
Last active January 13, 2025 01:51
Shows how to run Flux schnell under 17GBs without bells and whistles. It additionally shows how to serialize the quantized checkpoint and load it back.
import torch
from huggingface_hub import hf_hub_download
from diffusers import FluxTransformer2DModel, DiffusionPipeline
dtype, device = torch.bfloat16, "cuda"
ckpt_id = "black-forest-labs/FLUX.1-schnell"
with torch.device("meta"):
config = FluxTransformer2DModel.load_config(ckpt_id, subfolder="transformer")
model = FluxTransformer2DModel.from_config(config).to(dtype)
@dkurt
dkurt / CMakeLists.txt
Last active August 6, 2024 07:32
OpenVINO asynchronous C++ example
cmake_minimum_required(VERSION 3.4.3)
project(sample CXX)
find_package(InferenceEngine REQUIRED)
add_executable(${CMAKE_PROJECT_NAME} main.cpp)
target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_range_for)
target_link_libraries(${CMAKE_PROJECT_NAME}
@t27
t27 / visualise_tfrecord.ipynb
Last active November 18, 2020 07:36
Visualize a TFRecord for Tensorflow Object Detection Library
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gunnarx
gunnarx / gist:527fbc385a2e76f89609d837b6447f85
Last active December 3, 2024 07:45
Docker to Virtualbox
@mbinna
mbinna / effective_modern_cmake.md
Last active May 7, 2025 15:38
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@mrry
mrry / tensorflow_self_check.py
Last active September 26, 2024 15:39
[DEPRECATED] TensorFlow on Windows self-check
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@morgangiraud
morgangiraud / nvidia-reinstall.sh
Last active December 11, 2020 15:48
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
@nebgnahz
nebgnahz / gstreamer.md
Last active January 9, 2025 13:12
Collections of GStreamer usages

Most GStreamer examples found online are either for Linux or for gstreamer 0.10.

This particular release note seems to have covered important changes, such as:

  • ffmpegcolorspace => videoconvert
  • ffmpeg => libav

Applying -v will print out useful information. And most importantly the negotiation results.

@oilandrust
oilandrust / DataComponent.cpp
Created May 20, 2016 16:44
Bistsui DataComponent
#include <cassert>
#include <chrono>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
enum class DataType {
BOOL,