Commit
·
07b3917
1
Parent(s):
20c0646
fix prompt not on cuda
Browse files- core/bark/generate_audio.py +10 -1
core/bark/generate_audio.py
CHANGED
|
@@ -38,8 +38,17 @@ def generate_audio(
|
|
| 38 |
generation_config: configurations to generate audio
|
| 39 |
|
| 40 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
if prompt is not None:
|
| 42 |
-
semantic_prompt = prompt.semantic_prompt
|
| 43 |
# if len(semantic_prompt.shape) == 2:
|
| 44 |
# semantic_prompt = semantic_prompt[0, :]
|
| 45 |
assert (
|
|
|
|
| 38 |
generation_config: configurations to generate audio
|
| 39 |
|
| 40 |
"""
|
| 41 |
+
|
| 42 |
+
if prompt is not None:
|
| 43 |
+
if prompt.semantic_prompt is not None:
|
| 44 |
+
prompt.semantic_prompt = prompt.semantic_prompt.to("cuda")
|
| 45 |
+
if prompt.coarse_prompt is not None:
|
| 46 |
+
prompt.coarse_prompt = prompt.coarse_prompt.to("cuda")
|
| 47 |
+
if prompt.fine_prompt is not None:
|
| 48 |
+
prompt.fine_prompt = prompt.fine_prompt.to("cuda")
|
| 49 |
+
|
| 50 |
if prompt is not None:
|
| 51 |
+
semantic_prompt = prompt.semantic_prompt if prompt is not None else None
|
| 52 |
# if len(semantic_prompt.shape) == 2:
|
| 53 |
# semantic_prompt = semantic_prompt[0, :]
|
| 54 |
assert (
|