CineAI commited on
Commit
4acd1fa
1 Parent(s): adc2a9f

Update audio_processing/config.py

Browse files
Files changed (1) hide show
  1. audio_processing/config.py +15 -3
audio_processing/config.py CHANGED
@@ -1,16 +1,28 @@
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
+ from parler_tts import ParlerTTSForConditionalGeneration
5
+ from transformers import AutoTokenizer, AutoFeatureExtractor
6
 
7
  # 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/
8
  # Here ArticMonkey is name of version and rest of all is data and time
9
 
10
  device = 0 if torch.cuda.is_available() else "cpu"
11
 
12
+ checkpoint_whisper = "openai/whisper-medium"
13
+
14
  pipe = pipeline(
15
  "automatic-speech-recognition",
16
+ model=checkpoint_whisper,
17
  device=device,
18
  chunk_length_s=30,
19
+ )
20
+
21
+ checkpoint_parler = "parler-tts/parler_tts_mini_v0.1"
22
+
23
+ model_parler = ParlerTTSForConditionalGeneration.from_pretrained(checkpoint_parler).to(device)
24
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint_parler)
25
+ feature_extractor = AutoFeatureExtractor.from_pretrained(checkpoint_parler)
26
+
27
+ SAMPLE_RATE = feature_extractor.sampling_rate
28
+ SEED = 42