Omnibus commited on
Commit
88cd06b
·
1 Parent(s): f3aa612

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,11 +1,19 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoProcessor, AutoModel
4
  import scipy
5
 
6
 
 
 
 
 
 
 
 
7
  processor = AutoProcessor.from_pretrained("suno/bark-small")
8
- model = AutoModel.from_pretrained("suno/bark-small")
 
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):