Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoProcessor,
|
4 |
import scipy
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
processor = AutoProcessor.from_pretrained("suno/bark-small")
|
8 |
-
model =
|
|
|
9 |
|
10 |
|
11 |
def run_bark(text, lang="en", n=1):
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from transformers import AutoProcessor, BarkModel
|
4 |
import scipy
|
5 |
|
6 |
|
7 |
+
# device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
+
# model = BarkModel.from_pretrained("suno/bark-small", torch_dtype=torch.float16).to(device)
|
9 |
+
# model.enable_cpu_offload()
|
10 |
+
|
11 |
+
device = "cpu"
|
12 |
+
|
13 |
+
|
14 |
processor = AutoProcessor.from_pretrained("suno/bark-small")
|
15 |
+
model = BarkModel.from_pretrained("suno/bark-small").to(device)
|
16 |
+
|
17 |
|
18 |
|
19 |
def run_bark(text, lang="en", n=1):
|