Commit
·
d914b65
1
Parent(s):
a020f1f
Update pipeline.py
Browse files- pipeline.py +2 -2
pipeline.py
CHANGED
|
@@ -52,8 +52,8 @@ class PreTrainedPipeline():
|
|
| 52 |
print('Init')
|
| 53 |
self.sampling_rate = 16000
|
| 54 |
|
| 55 |
-
self.processor = Wav2Vec2Processor.from_pretrained(
|
| 56 |
-
self.model = Wav2Vec2ForCTC.from_pretrained(
|
| 57 |
self.group_ids = [sorted(self.processor.tokenizer.convert_tokens_to_ids(group)) for group in groups]
|
| 58 |
self.group_ids = [dict([(x[0]+1,x[1]) for x in list(enumerate(g))]) for g in self.group_ids] #This is the inversion of the one used in training as here we need to map prediction back to original tokens
|
| 59 |
|
|
|
|
| 52 |
print('Init')
|
| 53 |
self.sampling_rate = 16000
|
| 54 |
|
| 55 |
+
self.processor = Wav2Vec2Processor.from_pretrained(path)
|
| 56 |
+
self.model = Wav2Vec2ForCTC.from_pretrained(path)
|
| 57 |
self.group_ids = [sorted(self.processor.tokenizer.convert_tokens_to_ids(group)) for group in groups]
|
| 58 |
self.group_ids = [dict([(x[0]+1,x[1]) for x in list(enumerate(g))]) for g in self.group_ids] #This is the inversion of the one used in training as here we need to map prediction back to original tokens
|
| 59 |
|