aurelben commited on
Commit
419feaa
1 Parent(s): c451935

change whisper version

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -7,6 +7,9 @@ from groq import Groq
7
  from transformers import pipeline
8
  from TTS.api import TTS
9
 
 
 
 
10
  MODEL_NAME = "openai/whisper-large-v3"
11
  BATCH_SIZE = 8
12
  FILE_LIMIT_MB = 1000
@@ -75,7 +78,7 @@ def process_audio(input_audio, new_chunk):
75
  stream, transcription = transcribe(input_audio, new_chunk)
76
  text = autocomplete(transcription)
77
  print (transcription, text)
78
- api = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
79
  api.tts_to_file(text, file_path="output.wav", speaker="Ana Florence",language="fr", split_sentences=True)
80
  audio = "./output.wav"
81
  return stream, text, audio
 
7
  from transformers import pipeline
8
  from TTS.api import TTS
9
 
10
+ # Get device
11
+ device = "cuda" if torch.cuda.is_available() else "cpu"
12
+
13
  MODEL_NAME = "openai/whisper-large-v3"
14
  BATCH_SIZE = 8
15
  FILE_LIMIT_MB = 1000
 
78
  stream, transcription = transcribe(input_audio, new_chunk)
79
  text = autocomplete(transcription)
80
  print (transcription, text)
81
+ api = TTS("tts_models/de/thorsten/tacotron2-DDC").to(device)
82
  api.tts_to_file(text, file_path="output.wav", speaker="Ana Florence",language="fr", split_sentences=True)
83
  audio = "./output.wav"
84
  return stream, text, audio