Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from transformers import AutoProcessor,
|
| 3 |
import torchaudio
|
| 4 |
import soundfile as sf
|
| 5 |
import torch
|
|
@@ -27,8 +27,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 27 |
# Function to load and cache the model and processor
|
| 28 |
@st.cache_resource
|
| 29 |
def load_model_and_processor():
|
| 30 |
-
processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-
|
| 31 |
-
model =
|
| 32 |
model.to(device)
|
| 33 |
return processor, model
|
| 34 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import AutoProcessor, SeamlessM4TModel
|
| 3 |
import torchaudio
|
| 4 |
import soundfile as sf
|
| 5 |
import torch
|
|
|
|
| 27 |
# Function to load and cache the model and processor
|
| 28 |
@st.cache_resource
|
| 29 |
def load_model_and_processor():
|
| 30 |
+
processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
|
| 31 |
+
model = SeamlessM4TModel.from_pretrained("facebook/hf-seamless-m4t-medium")
|
| 32 |
model.to(device)
|
| 33 |
return processor, model
|
| 34 |
|