fixing brain worms

This commit is contained in:
mrq 2023-02-16 21:36:49 +00:00
parent d53edf540e
commit 30298b9ca3
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,14 @@
import webui as mrq import webui as mrq
if 'XDG_CACHE_HOME' not in os.environ:
os.environ['XDG_CACHE_HOME'] = os.path.realpath('./models/')
if 'TORTOISE_MODELS_DIR' not in os.environ:
os.environ['TORTOISE_MODELS_DIR'] = os.path.realpath('./models/tortoise/')
if 'TRANSFORMERS_CACHE' not in os.environ:
os.environ['TRANSFORMERS_CACHE'] = os.path.realpath('./models/transformers/')
if __name__ == "__main__": if __name__ == "__main__":
mrq.args = mrq.setup_args() mrq.args = mrq.setup_args()

View File

@ -6,12 +6,6 @@ import gc
from time import time from time import time
from urllib import request from urllib import request
if 'TORTOISE_MODELS_DIR' not in os.environ:
os.environ['TORTOISE_MODELS_DIR'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/tortoise/')
if 'TRANSFORMERS_CACHE' not in os.environ:
os.environ['TRANSFORMERS_CACHE'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/transformers/')
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
import progressbar import progressbar
@ -38,7 +32,7 @@ pbar = None
STOP_SIGNAL = False STOP_SIGNAL = False
MODELS_DIR = os.environ.get('TORTOISE_MODELS_DIR') MODELS_DIR = os.environ.get('TORTOISE_MODELS_DIR', os.path.realpath('./models/tortoise/'))
MODELS = { MODELS = {
'autoregressive.pth': 'https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/autoregressive.pth', 'autoregressive.pth': 'https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/autoregressive.pth',
'classifier.pth': 'https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/classifier.pth', 'classifier.pth': 'https://huggingface.co/jbetker/tortoise-tts-v2/resolve/main/.models/classifier.pth',