fixed wrong file path

This commit is contained in:
Brett Kuprel 2022-07-01 10:58:29 -04:00
parent fffd0f2b83
commit 7bf76deafb
3 changed files with 2 additions and 3 deletions

View File

@ -129,7 +129,7 @@ def convert_and_save_torch_params(is_mega: bool, model_path: str):
encoder_params[i] = encoder_params[i].to(torch.float16) encoder_params[i] = encoder_params[i].to(torch.float16)
detoker_params = load_vqgan_torch_params('./pretrained/vqgan') detoker_params = load_vqgan_torch_params('./pretrained/vqgan')
detoker_path = os.path.join('pretrained', 'vqgan', 'detokenizer.pt') detoker_path = os.path.join('pretrained', 'vqgan', 'detoker.pt')
torch.save(encoder_params, os.path.join(model_path, 'encoder.pt')) torch.save(encoder_params, os.path.join(model_path, 'encoder.pt'))
torch.save(decoder_params, os.path.join(model_path, 'decoder.pt')) torch.save(decoder_params, os.path.join(model_path, 'decoder.pt'))

View File

@ -3,7 +3,6 @@ import json
import numpy import numpy
from .text_tokenizer import TextTokenizer from .text_tokenizer import TextTokenizer
from .models.vqgan_detokenizer import VQGanDetokenizer
class MinDalleBase: class MinDalleBase:
def __init__(self, is_mega: bool): def __init__(self, is_mega: bool):

View File

@ -27,7 +27,7 @@ class MinDalleTorch(MinDalleBase):
self.encoder_params_path = os.path.join(self.model_path, 'encoder.pt') self.encoder_params_path = os.path.join(self.model_path, 'encoder.pt')
self.decoder_params_path = os.path.join(self.model_path, 'decoder.pt') self.decoder_params_path = os.path.join(self.model_path, 'decoder.pt')
self.detoker_params_path = os.path.join('pretrained', 'vqgan', 'detokenizer.pt') self.detoker_params_path = os.path.join('pretrained', 'vqgan', 'detoker.pt')
is_converted = os.path.exists(self.encoder_params_path) is_converted = os.path.exists(self.encoder_params_path)
is_converted &= os.path.exists(self.decoder_params_path) is_converted &= os.path.exists(self.decoder_params_path)