Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,8 +39,8 @@ def transcribe_and_optionally_translate(video_file, source_language, target_lang
|
|
| 39 |
audio_file = extract_audio(video_file)
|
| 40 |
|
| 41 |
# Transcription
|
| 42 |
-
device = "cpu"
|
| 43 |
-
compute_type = "int8"
|
| 44 |
model = WhisperModel(model_size, device=device, compute_type=compute_type)
|
| 45 |
segments, _ = model.transcribe(audio_file, source_language=source_language)
|
| 46 |
transcription = " ".join([segment.text for segment in segments])
|
|
|
|
| 39 |
audio_file = extract_audio(video_file)
|
| 40 |
|
| 41 |
# Transcription
|
| 42 |
+
device = "cpu" # GPU : cuda CPU : cpu
|
| 43 |
+
compute_type = "int8" # GPU : float16 or int8 - CPU : int8
|
| 44 |
model = WhisperModel(model_size, device=device, compute_type=compute_type)
|
| 45 |
segments, _ = model.transcribe(audio_file, source_language=source_language)
|
| 46 |
transcription = " ".join([segment.text for segment in segments])
|