Update gradio_app.py

This commit is contained in:
Rumah 2024-04-05 17:54:24 +08:00 committed by GitHub
parent fcdd1d30af
commit 0f5451bf4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,4 @@
import os
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
@ -16,6 +14,9 @@ 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