Skip to content

Instantly share code, notes, and snippets.

@Stella2211
Stella2211 / mem_eff_fp8_convert.py
Last active November 1, 2024 12:48
メモリ効率のいいfp8化スクリプト。 / Memory efficient fp8 conversion script.
import json
from pathlib import Path
import torch
from tqdm import tqdm
import struct
from typing import Dict, Any
import sys
# input file
if(len(sys.argv) < 3):
@Stella2211
Stella2211 / DeepFloyd_IF_VRAM12GB.py
Last active January 17, 2024 03:59
DeepFloyd IF for around 12GB of VRAM
# huggingface login
from huggingface_hub import login
login()
# load textencorder in 8bit quantized
from transformers import T5EncoderModel
from diffusers import DiffusionPipeline
import datetime