Spaces:
Runtime error
Runtime error
remove comments
Browse files
app.py
CHANGED
@@ -52,10 +52,7 @@ def predict(
|
|
52 |
|
53 |
arr, org_sr = torchaudio.load(input_data)
|
54 |
new_arr = torchaudio.functional.resample(arr, orig_freq=org_sr, new_freq=AUDIO_SAMPLE_RATE)
|
55 |
-
|
56 |
-
# if new_arr.shape[1] > max_length:
|
57 |
-
# new_arr = new_arr[:, :max_length]
|
58 |
-
# gr.Warning(f"Input audio is too long. Only the first {MAX_INPUT_AUDIO_LENGTH} seconds is used.")
|
59 |
torchaudio.save(input_data, new_arr, sample_rate=int(AUDIO_SAMPLE_RATE))
|
60 |
|
61 |
text_out, wav, sr = translator.predict(
|
@@ -77,8 +74,6 @@ def update_audio_ui(audio_source: str) -> tuple[dict, dict]:
|
|
77 |
)
|
78 |
|
79 |
|
80 |
-
# ... (previous parts of the code remain unchanged)
|
81 |
-
|
82 |
with gr.Blocks(css="style.css") as demo:
|
83 |
|
84 |
gr.Markdown(DESCRIPTION)
|
|
|
52 |
|
53 |
arr, org_sr = torchaudio.load(input_data)
|
54 |
new_arr = torchaudio.functional.resample(arr, orig_freq=org_sr, new_freq=AUDIO_SAMPLE_RATE)
|
55 |
+
|
|
|
|
|
|
|
56 |
torchaudio.save(input_data, new_arr, sample_rate=int(AUDIO_SAMPLE_RATE))
|
57 |
|
58 |
text_out, wav, sr = translator.predict(
|
|
|
74 |
)
|
75 |
|
76 |
|
|
|
|
|
77 |
with gr.Blocks(css="style.css") as demo:
|
78 |
|
79 |
gr.Markdown(DESCRIPTION)
|