Spaces:
Runtime error
Runtime error
Commit
·
4ed25fe
1
Parent(s):
92a440c
switch tts to use cpu
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ vq_model = RQBottleneckTransformer.load_model(
|
|
| 21 |
"whisper-vq-stoks-medium-en+pl-fixed.model"
|
| 22 |
).to(device)
|
| 23 |
# tts = TTSProcessor('cpu')
|
|
|
|
| 24 |
use_8bit = False
|
| 25 |
llm_path = "homebrewltd/Llama3.1-s-instruct-2024-08-19-epoch-3"
|
| 26 |
tokenizer = AutoTokenizer.from_pretrained(llm_path)
|
|
@@ -74,7 +75,6 @@ def text_to_audio_file(text):
|
|
| 74 |
# remove the last character if it is a period
|
| 75 |
if text_split[-1] == ".":
|
| 76 |
text_split = text_split[:-1]
|
| 77 |
-
tts = TTSProcessor("cuda")
|
| 78 |
tts.convert_text_to_audio_file(text, temp_file)
|
| 79 |
# logging.info(f"Saving audio to {temp_file}")
|
| 80 |
# torchaudio.save(temp_file, audio.cpu(), sample_rate=24000)
|
|
@@ -167,7 +167,7 @@ examples = []
|
|
| 167 |
examples.extend(good_examples)
|
| 168 |
examples.extend(bad_examples)
|
| 169 |
with gr.Blocks() as iface:
|
| 170 |
-
gr.Markdown("# Llama3
|
| 171 |
gr.Markdown("Enter text to convert to audio, then submit the audio to generate text or Upload Audio")
|
| 172 |
|
| 173 |
with gr.Row():
|
|
|
|
| 21 |
"whisper-vq-stoks-medium-en+pl-fixed.model"
|
| 22 |
).to(device)
|
| 23 |
# tts = TTSProcessor('cpu')
|
| 24 |
+
tts = TTSProcessor("cpu")
|
| 25 |
use_8bit = False
|
| 26 |
llm_path = "homebrewltd/Llama3.1-s-instruct-2024-08-19-epoch-3"
|
| 27 |
tokenizer = AutoTokenizer.from_pretrained(llm_path)
|
|
|
|
| 75 |
# remove the last character if it is a period
|
| 76 |
if text_split[-1] == ".":
|
| 77 |
text_split = text_split[:-1]
|
|
|
|
| 78 |
tts.convert_text_to_audio_file(text, temp_file)
|
| 79 |
# logging.info(f"Saving audio to {temp_file}")
|
| 80 |
# torchaudio.save(temp_file, audio.cpu(), sample_rate=24000)
|
|
|
|
| 167 |
examples.extend(good_examples)
|
| 168 |
examples.extend(bad_examples)
|
| 169 |
with gr.Blocks() as iface:
|
| 170 |
+
gr.Markdown("# Llama3.1-S: checkpoint Aug 19, 2024")
|
| 171 |
gr.Markdown("Enter text to convert to audio, then submit the audio to generate text or Upload Audio")
|
| 172 |
|
| 173 |
with gr.Row():
|