Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ processor = AutoProcessor.from_pretrained("suno/bark-small")
|
|
| 14 |
#model = BetterTransformer.transform(model, keep_original_model=False)
|
| 15 |
|
| 16 |
# Enable CPU offload
|
| 17 |
-
model.enable_cpu_offload()
|
| 18 |
|
| 19 |
import numpy as np
|
| 20 |
from scipy.io import wavfile
|
|
@@ -23,6 +23,7 @@ from scipy.io import wavfile
|
|
| 23 |
def infer(text_prompt):
|
| 24 |
text_prompt = text_prompt
|
| 25 |
inputs = processor(text_prompt).to(device)
|
|
|
|
| 26 |
with torch.inference_mode():
|
| 27 |
speech_output = model.generate(**inputs, do_sample = True, fine_temperature = 0.4, coarse_temperature = 0.8)
|
| 28 |
audio_out = speech_output[0].cpu().numpy()
|
|
|
|
| 14 |
#model = BetterTransformer.transform(model, keep_original_model=False)
|
| 15 |
|
| 16 |
# Enable CPU offload
|
| 17 |
+
#model.enable_cpu_offload()
|
| 18 |
|
| 19 |
import numpy as np
|
| 20 |
from scipy.io import wavfile
|
|
|
|
| 23 |
def infer(text_prompt):
|
| 24 |
text_prompt = text_prompt
|
| 25 |
inputs = processor(text_prompt).to(device)
|
| 26 |
+
|
| 27 |
with torch.inference_mode():
|
| 28 |
speech_output = model.generate(**inputs, do_sample = True, fine_temperature = 0.4, coarse_temperature = 0.8)
|
| 29 |
audio_out = speech_output[0].cpu().numpy()
|