Update app.py
Browse files
app.py
CHANGED
|
@@ -62,11 +62,11 @@ def transcribe_common(audio: str, model: str) -> str:
|
|
| 62 |
y, sr = librosa.load("temp.wav", mono=True, sr=16000)
|
| 63 |
Path("temp.wav").unlink()
|
| 64 |
# Get duration of audio
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
start_time = time.time()
|
| 71 |
result = pipe_dict[model](y, generate_kwargs=generate_kwargs)["text"]
|
| 72 |
end_time = time.time()
|
|
|
|
| 62 |
y, sr = librosa.load("temp.wav", mono=True, sr=16000)
|
| 63 |
Path("temp.wav").unlink()
|
| 64 |
# Get duration of audio
|
| 65 |
+
# duration = librosa.get_duration(y=y, sr=sr)
|
| 66 |
+
# logger.info(f"Duration: {duration:.2f}s")
|
| 67 |
+
# if duration > 15:
|
| 68 |
+
# logger.error(f"Audio too long, limit is 15 seconds, got {duration:.2f}s")
|
| 69 |
+
# return f"Audio too long, limit is 15 seconds, got {duration:.2f}s"
|
| 70 |
start_time = time.time()
|
| 71 |
result = pipe_dict[model](y, generate_kwargs=generate_kwargs)["text"]
|
| 72 |
end_time = time.time()
|