Update audio2text/init.py
Browse files- audio2text/init.py +8 -3
audio2text/init.py
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
-
from transformers import
|
2 |
|
3 |
# ArticMonkey:19.03.24:1700 example of version name in plaintext will be convert into hex using this site -> https://magictool.ai/tool/text-to-hex-converter/
|
4 |
# Here ArticMonkey is name of version and rest of all is data and time
|
5 |
|
|
|
|
|
6 |
checkpoint = "openai/whisper-base"
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
|
3 |
# ArticMonkey:19.03.24:1700 example of version name in plaintext will be convert into hex using this site -> https://magictool.ai/tool/text-to-hex-converter/
|
4 |
# Here ArticMonkey is name of version and rest of all is data and time
|
5 |
|
6 |
+
device = 0 if torch.cuda.is_available() else "cpu"
|
7 |
+
|
8 |
checkpoint = "openai/whisper-base"
|
9 |
+
pipe = pipeline(
|
10 |
+
task="automatic-speech-recognition",
|
11 |
+
model=checkpoint,
|
12 |
+
device=device,
|
13 |
+
)
|