Update README.md
Browse files
README.md
CHANGED
@@ -50,9 +50,10 @@ An external `py_module_file=custom_interface.py` is used as an external Predicto
|
|
50 |
|
51 |
```python
|
52 |
from speechbrain.inference.interfaces import foreign_class
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
56 |
print(predictions)
|
57 |
```
|
58 |
|
|
|
50 |
|
51 |
```python
|
52 |
from speechbrain.inference.interfaces import foreign_class
|
53 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
54 |
+
asr_classifier = foreign_class(source="Macedonian-ASR/wav2vec2-aed-macedonian-asr", pymodule_file="custom_interface.py", classname="ASR")
|
55 |
+
asr_classifier = asr_classifier.to(device)
|
56 |
+
predictions = asr_classifier.classify_file("your/audio/file.wav", device)
|
57 |
print(predictions)
|
58 |
```
|
59 |
|