CineAI commited on
Commit
78714c6
1 Parent(s): 65cb1fd

Update audio2text/init.py

Browse files
Files changed (1) hide show
  1. audio2text/init.py +12 -12
audio2text/init.py CHANGED
@@ -1,16 +1,16 @@
1
- # import torch
2
 
3
- # from transformers import pipeline
4
 
5
- # # 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/
6
- # # Here ArticMonkey is name of version and rest of all is data and time
7
 
8
- # device = 0 if torch.cuda.is_available() else "cpu"
9
 
10
- # checkpoint = "openai/whisper-medium"
11
- # pipe = pipeline(
12
- # "automatic-speech-recognition",
13
- # model=checkpoint,
14
- # device=device,
15
- # chunk_length_s=30,
16
- # )
 
1
+ import torch
2
 
3
+ from transformers import pipeline
4
 
5
+ # 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/
6
+ # Here ArticMonkey is name of version and rest of all is data and time
7
 
8
+ device = 0 if torch.cuda.is_available() else "cpu"
9
 
10
+ checkpoint = "openai/whisper-medium"
11
+ pipe = pipeline(
12
+ "automatic-speech-recognition",
13
+ model=checkpoint,
14
+ device=device,
15
+ chunk_length_s=30,
16
+ )