Spaces:
Sleeping
Sleeping
fix: reorganize import statements for clarity and remove unused imports
Browse files
src/AI_Models/wave2vec_inference.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
import torch
|
2 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
3 |
import onnxruntime as rt
|
4 |
import numpy as np
|
5 |
import librosa
|
@@ -101,11 +106,6 @@ class Wave2Vec2ONNXInference:
|
|
101 |
return self.buffer_to_text(audio_input)
|
102 |
|
103 |
|
104 |
-
from onnxruntime.quantization.quantize import quantize
|
105 |
-
from transformers import Wav2Vec2ForCTC
|
106 |
-
import torch
|
107 |
-
import argparse
|
108 |
-
|
109 |
# took that script from: https://github.com/ccoreilly/wav2vec2-service/blob/master/convert_torch_to_onnx.py
|
110 |
|
111 |
|
|
|
1 |
import torch
|
2 |
+
from transformers import (
|
3 |
+
AutoModelForCTC,
|
4 |
+
AutoProcessor,
|
5 |
+
Wav2Vec2Processor,
|
6 |
+
Wav2Vec2ForCTC,
|
7 |
+
)
|
8 |
import onnxruntime as rt
|
9 |
import numpy as np
|
10 |
import librosa
|
|
|
106 |
return self.buffer_to_text(audio_input)
|
107 |
|
108 |
|
|
|
|
|
|
|
|
|
|
|
109 |
# took that script from: https://github.com/ccoreilly/wav2vec2-service/blob/master/convert_torch_to_onnx.py
|
110 |
|
111 |
|