Skip to content

Instantly share code, notes, and snippets.

View tenacemenace's full-sized avatar
😃
Bed,eat,school,sleep,code this im doing in my whole live

tenacemenace tenacemenace

😃
Bed,eat,school,sleep,code this im doing in my whole live
  • januszex
  • Samsung galaxy s5
View GitHub Profile
@tenacemenace
tenacemenace / wyciagach_vae_i_itd
Created August 13, 2026 05:09
Prosty program do wyciagania vae i clip dla modeli ktore kompresujesz bo kompresacja zmiejsza dane i usuwa jakies elementy a ten skrypt z oryginalnego pliku je przywraca
from pathlib import Path
from safetensors import safe_open
from safetensors.torch import save_file
def wyodrebnij_i_zapisz(wagi, sciezka_wyjsciowa, typ_komponentu):
"""Zapisuje wycięte wagi do pliku."""
if wagi:
print(f"Zapisywanie {typ_komponentu} do: {sciezka_wyjsciowa.name}...")
save_file(wagi, str(sciezka_wyjsciowa))
print(f" [OK] Sukces! Zapisano {typ_komponentu}.")