Spaces:
Sleeping
Sleeping
change whisper version
Browse files
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/
|
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
|