Porjaz commited on
Commit
5fb5b17
·
verified ·
1 Parent(s): a3dadc7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
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
- classifier_test = foreign_class(source="Macedonian-ASR/wav2vec2-aed-macedonian-asr", pymodule_file="custom_interface.py", classname="ASR")
54
- classifier_test = classifier_test.to(device)
55
- predictions = classifier_test.classify_file("/m/triton/scratch/elec/t405-puhe/p/porjazd1/macedonian_asr/data/youtube_audio/audio/vesti_2.m4a", device)
 
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