Instructions to use S-Fry/large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use S-Fry/large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="S-Fry/large")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("S-Fry/large") model = AutoModelForSpeechSeq2Seq.from_pretrained("S-Fry/large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -7,7 +7,7 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
| 7 |
SAMPLE_RATE=16000
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
-
|
| 11 |
self.pipe = pipeline(
|
| 12 |
"automatic-speech-recognition",
|
| 13 |
model="openai/whisper-large",
|
|
|
|
| 7 |
SAMPLE_RATE=16000
|
| 8 |
class EndpointHandler():
|
| 9 |
def __init__(self, path=""):
|
| 10 |
+
self.device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 11 |
self.pipe = pipeline(
|
| 12 |
"automatic-speech-recognition",
|
| 13 |
model="openai/whisper-large",
|