Spaces:
Runtime error
Runtime error
Update inference_from_video.py
Browse files- inference_from_video.py +5 -1
inference_from_video.py
CHANGED
|
@@ -68,6 +68,10 @@ def parse_args():
|
|
| 68 |
"--sample_rate", type=int, default=16000,
|
| 69 |
help="Sample rate for audio output.",
|
| 70 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
parser.add_argument(
|
| 72 |
"--save_dir", type=str, default="./outputs/tmp",
|
| 73 |
help="output save dir"
|
|
@@ -140,7 +144,7 @@ def main():
|
|
| 140 |
sample_rate = args.sample_rate
|
| 141 |
|
| 142 |
# Define max_len_in_seconds globally for consistency
|
| 143 |
-
max_len_in_seconds =
|
| 144 |
|
| 145 |
def audio_text_matching(waveforms, text, sample_freq=24000, max_len_in_seconds=max_len_in_seconds):
|
| 146 |
new_freq = 48000
|
|
|
|
| 68 |
"--sample_rate", type=int, default=16000,
|
| 69 |
help="Sample rate for audio output.",
|
| 70 |
)
|
| 71 |
+
parser.add_argument(
|
| 72 |
+
"--max_duration", type=int, default=10,
|
| 73 |
+
help="Maximum length duration for generated audio."
|
| 74 |
+
)
|
| 75 |
parser.add_argument(
|
| 76 |
"--save_dir", type=str, default="./outputs/tmp",
|
| 77 |
help="output save dir"
|
|
|
|
| 144 |
sample_rate = args.sample_rate
|
| 145 |
|
| 146 |
# Define max_len_in_seconds globally for consistency
|
| 147 |
+
max_len_in_seconds = args.max_duration
|
| 148 |
|
| 149 |
def audio_text_matching(waveforms, text, sample_freq=24000, max_len_in_seconds=max_len_in_seconds):
|
| 150 |
new_freq = 48000
|