Added device variable
Browse files
app.py
CHANGED
@@ -7,15 +7,17 @@ from transformers import AutoProcessor, ClapModel
|
|
7 |
import torch
|
8 |
# import scipy
|
9 |
|
|
|
|
|
10 |
repo_id = "cvssp/audioldm-s-full-v2"
|
11 |
pipe = AudioLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float32)
|
12 |
#pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
13 |
-
pipe = pipe.to(
|
14 |
|
15 |
clap_model = ClapModel.from_pretrained("sanchit-gandhi/clap-htsat-unfused-m-full").to(device)
|
16 |
processor = AutoProcessor.from_pretrained("sanchit-gandhi/clap-htsat-unfused-m-full")
|
17 |
|
18 |
-
generator = torch.Generator(
|
19 |
|
20 |
def texttoaudio(prompt, neg_prompt, seed, inf_steps, guidance_scale):
|
21 |
if prompt is None:
|
|
|
7 |
import torch
|
8 |
# import scipy
|
9 |
|
10 |
+
device="cpu"
|
11 |
+
|
12 |
repo_id = "cvssp/audioldm-s-full-v2"
|
13 |
pipe = AudioLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float32)
|
14 |
#pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
15 |
+
pipe = pipe.to(device)
|
16 |
|
17 |
clap_model = ClapModel.from_pretrained("sanchit-gandhi/clap-htsat-unfused-m-full").to(device)
|
18 |
processor = AutoProcessor.from_pretrained("sanchit-gandhi/clap-htsat-unfused-m-full")
|
19 |
|
20 |
+
generator = torch.Generator(device)
|
21 |
|
22 |
def texttoaudio(prompt, neg_prompt, seed, inf_steps, guidance_scale):
|
23 |
if prompt is None:
|