Skip to content
Discussion options

You must be logged in to vote

If you want to reduce the weight from 5GB to 1.8GB.
You need to remove it from the model optimizer.

import os
import glob
import torch

def find_latest_best_model(folder_path):
    search_path = "/content/drive/MyDrive/tts/GPT_XTTS_FT-December-27-2023_03+32PM-0000000/checkpoint_9000.pth"
    files = glob.glob(search_path, recursive=True)
    latest_file = max(files, key=os.path.getctime, default=None)
    return latest_file

model_path = find_latest_best_model("/content/drive/MyDrive/tts")
checkpoint = torch.load(model_path, map_location=torch.device("cpu"))
del checkpoint["optimizer"]
for key in list(checkpoint["model"].keys()):
    if "dvae" in key:
        del checkpoint["model"][key]
…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@erew123
Comment options

Answer selected by erew123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants