This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}.") |