Spaces:
Running on T4
Running on T4
Removing my attempt to use ZeroGPU.
Browse files- src/process.py +3 -3
src/process.py
CHANGED
|
@@ -2,7 +2,7 @@ import difflib
|
|
| 2 |
import re
|
| 3 |
from functools import lru_cache
|
| 4 |
|
| 5 |
-
import spaces
|
| 6 |
import gradio.components.audio as gr_audio
|
| 7 |
import torch
|
| 8 |
from transformers import pipeline
|
|
@@ -21,8 +21,8 @@ def normalize_text(t: str, lower: bool = True) -> str:
|
|
| 21 |
return t
|
| 22 |
|
| 23 |
|
|
|
|
| 24 |
@lru_cache(maxsize=2)
|
| 25 |
-
@spaces.GPU
|
| 26 |
def get_asr_pipeline(model_id: str, device_preference: str) -> pipeline:
|
| 27 |
"""Cache an ASR pipeline.
|
| 28 |
Parameters:
|
|
@@ -40,7 +40,7 @@ def get_asr_pipeline(model_id: str, device_preference: str) -> pipeline:
|
|
| 40 |
return pipeline(
|
| 41 |
"automatic-speech-recognition",
|
| 42 |
model=model_id, # use English-only Whisper models (.en)
|
| 43 |
-
|
| 44 |
chunk_length_s=30,
|
| 45 |
return_timestamps=False,
|
| 46 |
)
|
|
|
|
| 2 |
import re
|
| 3 |
from functools import lru_cache
|
| 4 |
|
| 5 |
+
#import spaces
|
| 6 |
import gradio.components.audio as gr_audio
|
| 7 |
import torch
|
| 8 |
from transformers import pipeline
|
|
|
|
| 21 |
return t
|
| 22 |
|
| 23 |
|
| 24 |
+
#@spaces.GPU
|
| 25 |
@lru_cache(maxsize=2)
|
|
|
|
| 26 |
def get_asr_pipeline(model_id: str, device_preference: str) -> pipeline:
|
| 27 |
"""Cache an ASR pipeline.
|
| 28 |
Parameters:
|
|
|
|
| 40 |
return pipeline(
|
| 41 |
"automatic-speech-recognition",
|
| 42 |
model=model_id, # use English-only Whisper models (.en)
|
| 43 |
+
device=device,
|
| 44 |
chunk_length_s=30,
|
| 45 |
return_timestamps=False,
|
| 46 |
)
|