CineAI commited on
Commit
33273c7
1 Parent(s): fd86276

Update audio2text/init.py

Browse files
Files changed (1) hide show
  1. audio2text/init.py +8 -3
audio2text/init.py CHANGED
@@ -1,8 +1,13 @@
1
- from transformers import WhisperProcessor, WhisperForConditionalGeneration
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
- processor = WhisperProcessor.from_pretrained(checkpoint)
8
- model = WhisperForConditionalGeneration.from_pretrained(checkpoint)
 
 
 
 
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
+ )