Spaces:
Running
Running
mrfakename
commited on
Commit
•
f514292
1
Parent(s):
6c9d0da
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
src/f5_tts/infer/utils_infer.py
CHANGED
@@ -119,12 +119,16 @@ def load_vocoder(vocoder_name="vocos", is_local=False, local_path="", device=dev
|
|
119 |
asr_pipe = None
|
120 |
|
121 |
|
122 |
-
def initialize_asr_pipeline(device=device):
|
|
|
|
|
|
|
|
|
123 |
global asr_pipe
|
124 |
asr_pipe = pipeline(
|
125 |
"automatic-speech-recognition",
|
126 |
model="openai/whisper-large-v3-turbo",
|
127 |
-
torch_dtype=
|
128 |
device=device,
|
129 |
)
|
130 |
|
|
|
119 |
asr_pipe = None
|
120 |
|
121 |
|
122 |
+
def initialize_asr_pipeline(device=device, dtype=None):
|
123 |
+
if dtype is None:
|
124 |
+
dtype = (
|
125 |
+
torch.float16 if device == "cuda" and torch.cuda.get_device_properties(device).major >= 6 else torch.float32
|
126 |
+
)
|
127 |
global asr_pipe
|
128 |
asr_pipe = pipeline(
|
129 |
"automatic-speech-recognition",
|
130 |
model="openai/whisper-large-v3-turbo",
|
131 |
+
torch_dtype=dtype,
|
132 |
device=device,
|
133 |
)
|
134 |
|