Spaces:
Sleeping
Sleeping
Add get_character function
Browse files- characters/__init__.py +4 -0
- cli.py +2 -2
characters/__init__.py
CHANGED
|
@@ -14,3 +14,7 @@ for file in pathlib.Path(__file__).parent.glob("*.py"):
|
|
| 14 |
if hasattr(module, "get_character"):
|
| 15 |
c: Character = getattr(module, "get_character")()
|
| 16 |
CHARACTERS[file.stem] = c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
if hasattr(module, "get_character"):
|
| 15 |
c: Character = getattr(module, "get_character")()
|
| 16 |
CHARACTERS[file.stem] = c
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def get_character(name: str) -> Character:
|
| 20 |
+
return CHARACTERS[name]
|
cli.py
CHANGED
|
@@ -4,7 +4,7 @@ from pathlib import Path
|
|
| 4 |
|
| 5 |
import yaml
|
| 6 |
|
| 7 |
-
from characters import
|
| 8 |
from pipeline import SingingDialoguePipeline
|
| 9 |
|
| 10 |
logger = getLogger(__name__)
|
|
@@ -34,7 +34,7 @@ def main():
|
|
| 34 |
speaker = config["speaker"]
|
| 35 |
language = config["language"]
|
| 36 |
character_name = config["prompt_template_character"]
|
| 37 |
-
character =
|
| 38 |
prompt_template = character.prompt
|
| 39 |
results = pipeline.run(
|
| 40 |
args.query_audio,
|
|
|
|
| 4 |
|
| 5 |
import yaml
|
| 6 |
|
| 7 |
+
from characters import get_character
|
| 8 |
from pipeline import SingingDialoguePipeline
|
| 9 |
|
| 10 |
logger = getLogger(__name__)
|
|
|
|
| 34 |
speaker = config["speaker"]
|
| 35 |
language = config["language"]
|
| 36 |
character_name = config["prompt_template_character"]
|
| 37 |
+
character = get_character(character_name)
|
| 38 |
prompt_template = character.prompt
|
| 39 |
results = pipeline.run(
|
| 40 |
args.query_audio,
|