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")# 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
|
@@ -23,7 +23,7 @@ class EndpointHandler():
|
|
| 23 |
audio_tensor = torch.from_numpy(audio_nparray)
|
| 24 |
|
| 25 |
prediction = pipe(audio_nparray, return_timestamps=True)
|
| 26 |
-
return {"text": prediction[0]
|
| 27 |
|
| 28 |
# we can also return timestamps for the predictions
|
| 29 |
#prediction = pipe(sample, return_timestamps=True)["chunks"]
|
|
|
|
| 23 |
audio_tensor = torch.from_numpy(audio_nparray)
|
| 24 |
|
| 25 |
prediction = pipe(audio_nparray, return_timestamps=True)
|
| 26 |
+
return {"text": prediction[0]}
|
| 27 |
|
| 28 |
# we can also return timestamps for the predictions
|
| 29 |
#prediction = pipe(sample, return_timestamps=True)["chunks"]
|