Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,15 +2,24 @@ import sys
|
|
2 |
import os
|
3 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'amt/src')))
|
4 |
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
import glob
|
7 |
import gradio as gr
|
8 |
|
9 |
-
|
10 |
|
11 |
# @title Load Checkpoint
|
12 |
model_name = 'YPTF.MoE+Multi (noPS)' # @param ["YMT3+", "YPTF+Single (noPS)", "YPTF+Multi (PS)", "YPTF.MoE+Multi (noPS)", "YPTF.MoE+Multi (PS)"]
|
13 |
-
precision = '16' # @param ["32", "bf16-mixed", "16"]
|
14 |
project = '2024'
|
15 |
|
16 |
if model_name == "YMT3+":
|
@@ -43,15 +52,7 @@ else:
|
|
43 |
model = load_model_checkpoint(args=args)
|
44 |
|
45 |
# @title GradIO helper
|
46 |
-
import os
|
47 |
-
import subprocess
|
48 |
-
from typing import Tuple, Dict, Literal
|
49 |
-
from ctypes import ArgumentError
|
50 |
|
51 |
-
from html_helper import *
|
52 |
-
|
53 |
-
from pytube import YouTube
|
54 |
-
import torchaudio
|
55 |
|
56 |
def prepare_media(source_path_or_url: os.PathLike,
|
57 |
source_type: Literal['audio_filepath', 'youtube_url'],
|
|
|
2 |
import os
|
3 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'amt/src')))
|
4 |
|
5 |
+
import subprocess
|
6 |
+
from typing import Tuple, Dict, Literal
|
7 |
+
from ctypes import ArgumentError
|
8 |
|
9 |
+
from html_helper import *
|
10 |
+
from model_helper import *
|
11 |
+
|
12 |
+
from pytube import YouTube
|
13 |
+
import torch
|
14 |
+
import torchaudio
|
15 |
import glob
|
16 |
import gradio as gr
|
17 |
|
18 |
+
|
19 |
|
20 |
# @title Load Checkpoint
|
21 |
model_name = 'YPTF.MoE+Multi (noPS)' # @param ["YMT3+", "YPTF+Single (noPS)", "YPTF+Multi (PS)", "YPTF.MoE+Multi (noPS)", "YPTF.MoE+Multi (PS)"]
|
22 |
+
precision = '16' if torch.cuda.is_available() else '32'# @param ["32", "bf16-mixed", "16"]
|
23 |
project = '2024'
|
24 |
|
25 |
if model_name == "YMT3+":
|
|
|
52 |
model = load_model_checkpoint(args=args)
|
53 |
|
54 |
# @title GradIO helper
|
|
|
|
|
|
|
|
|
55 |
|
|
|
|
|
|
|
|
|
56 |
|
57 |
def prepare_media(source_path_or_url: os.PathLike,
|
58 |
source_type: Literal['audio_filepath', 'youtube_url'],
|