Update app.py
Browse files
app.py
CHANGED
@@ -36,12 +36,12 @@ MODEL_NAME = "openai/whisper-medium"
|
|
36 |
FILE_LIMIT_MB = 1000
|
37 |
YT_LENGTH_LIMIT_S = 3600
|
38 |
|
39 |
-
device = 0 if torch.cuda.is_available() else "cpu"
|
40 |
|
41 |
pipe = pipeline(
|
42 |
task="automatic-speech-recognition",
|
43 |
model=MODEL_NAME,
|
44 |
-
|
45 |
device=device,
|
46 |
model_kwargs={"low_cpu_mem_usage": True},
|
47 |
)
|
|
|
36 |
FILE_LIMIT_MB = 1000
|
37 |
YT_LENGTH_LIMIT_S = 3600
|
38 |
|
39 |
+
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
40 |
|
41 |
pipe = pipeline(
|
42 |
task="automatic-speech-recognition",
|
43 |
model=MODEL_NAME,
|
44 |
+
chunk_length_s=30,
|
45 |
device=device,
|
46 |
model_kwargs={"low_cpu_mem_usage": True},
|
47 |
)
|