File size: 1,314 Bytes
d5436e0
 
 
2553409
 
 
 
 
 
 
4acd1fa
 
2553409
 
4acd1fa
2553409
 
4acd1fa
 
cd9b829
 
4acd1fa
cd9b829
4acd1fa
cd9b829
 
 
 
 
 
 
 
 
b86dfc7
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ArcticMonkey:19.03.24:1700 example of version name in plaintext  will be converted into hex using this site ->
# https://magictool.ai/tool/text-to-hex-converter/ Here ArcticMonkey is name of version and rest of all is data and time

import torch

from transformers import pipeline


device = 0 if torch.cuda.is_available() else "cpu"

checkpoint_whisper = "openai/whisper-medium"

pipe = pipeline(
    "automatic-speech-recognition",
    model=checkpoint_whisper,
    device=device,
    chunk_length_s=30, 
)

# from parler_tts import ParlerTTSForConditionalGeneration
# from transformers import AutoTokenizer, AutoFeatureExtractor

# checkpoint_parler = "parler-tts/parler_tts_mini_v0.1"

# model_parler = ParlerTTSForConditionalGeneration.from_pretrained(checkpoint_parler).to(device)
# tokenizer = AutoTokenizer.from_pretrained(checkpoint_parler)
# feature_extractor = AutoFeatureExtractor.from_pretrained(checkpoint_parler)

# SAMPLE_RATE = feature_extractor.sampling_rate
# SEED = 42

checkpoint_mms_tts_eng = "facebook/mms-tts-eng"

# from transformers import VitsModel, AutoTokenizer

# model_mms_tts_eng = VitsModel.from_pretrained(checkpoint_mms_tts_eng)
# tokenizer_mms_tts_eng = AutoTokenizer.from_pretrained(checkpoint_mms_tts_eng)

pipe_tts = pipeline("text-to-speech", model=checkpoint_mms_tts_eng)