Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,7 @@ def translate_srt(input_file_path, source_language_code, target_language_code, p
|
|
| 78 |
def transcribe(audio_file_path, model_size="base"):
|
| 79 |
device = "cpu"
|
| 80 |
compute_type = "int8"
|
| 81 |
-
model = WhisperModel(model_size
|
| 82 |
segments, _ = model.transcribe(audio_file_path)
|
| 83 |
transcription_with_timestamps = [
|
| 84 |
f"[{format_timestamp(segment.start)} -> {format_timestamp(segment.end)}] {segment.text}"
|
|
|
|
| 78 |
def transcribe(audio_file_path, model_size="base"):
|
| 79 |
device = "cpu"
|
| 80 |
compute_type = "int8"
|
| 81 |
+
model = WhisperModel(model_size, device=device, compute_type=compute_type)
|
| 82 |
segments, _ = model.transcribe(audio_file_path)
|
| 83 |
transcription_with_timestamps = [
|
| 84 |
f"[{format_timestamp(segment.start)} -> {format_timestamp(segment.end)}] {segment.text}"
|