Update gradio_app.py

This commit is contained in:
Rumah 2024-04-05 17:53:38 +08:00 committed by GitHub
parent 5c92b2864f
commit fcdd1d30af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,8 @@
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "0" # for local use
os.chdir("/content/VoiceCraft-gradio-colab")
os.environ['USER'] = 'aaa'
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0" # for local use
import gradio as gr
import torch
import torchaudio
@ -14,9 +16,6 @@ import numpy as np
import random
import uuid
os.chdir("/content/VoiceCraft-gradio-colab")
os.environ['USER'] = 'aaa'
TMP_PATH = os.getenv("TMP_PATH", "./demo/temp")
device = "cuda" if torch.cuda.is_available() else "cpu"
whisper_model, align_model, voicecraft_model = None, None, None