Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,17 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import torch
|
| 3 |
-
from
|
| 4 |
-
from transformers import AutoTokenizer
|
| 5 |
import soundfile as sf
|
| 6 |
|
| 7 |
# Set up the device
|
| 8 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Neon-themed styling
|
| 15 |
st.markdown("""
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import torch
|
| 3 |
+
from transformers import pipeline, AutoModelForSeq2SeqLM, AutoTokenizer
|
|
|
|
| 4 |
import soundfile as sf
|
| 5 |
|
| 6 |
# Set up the device
|
| 7 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 8 |
|
| 9 |
+
# Use pipeline as a high-level helper
|
| 10 |
+
pipe = pipeline("text-to-speech", model="ipsilondev/parler_tts")
|
| 11 |
+
|
| 12 |
+
# Load model directly
|
| 13 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("ipsilondev/parler_tts").to(device)
|
| 14 |
+
tokenizer = AutoTokenizer.from_pretrained("ipsilondev/parler_tts")
|
| 15 |
|
| 16 |
# Neon-themed styling
|
| 17 |
st.markdown("""
|