Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- src/vocalizr/__init__.py +7 -3
src/vocalizr/__init__.py
CHANGED
@@ -17,16 +17,20 @@ PIPELINE: KPipeline = KPipeline(lang_code="a", repo_id="hexgrad/Kokoro-82M")
|
|
17 |
CURRENT_DATE: str = datetime.now().strftime(format="%Y-%m-%d_%H-%M-%S")
|
18 |
|
19 |
BASE_DIR: Path = Path(__file__).parent.parent.parent
|
20 |
-
RESULTS_DIR: Path
|
21 |
LOG_DIR: Path = BASE_DIR / "logs"
|
22 |
-
AUDIO_FILE_PATH: Path
|
23 |
LOG_FILE_PATH: Path = LOG_DIR / f"{CURRENT_DATE}.log"
|
24 |
|
25 |
RESULTS_DIR.mkdir(exist_ok=True)
|
26 |
LOG_DIR.mkdir(exist_ok=True)
|
27 |
|
28 |
CUDA_AVAILABLE: bool = cuda.is_available()
|
29 |
-
logger.add(
|
|
|
|
|
|
|
|
|
30 |
logger.info(f"CUDA Available: {CUDA_AVAILABLE}")
|
31 |
logger.info(f"Char limit: {CHAR_LIMIT}")
|
32 |
logger.info(f"Base directory: {BASE_DIR}")
|
|
|
17 |
CURRENT_DATE: str = datetime.now().strftime(format="%Y-%m-%d_%H-%M-%S")
|
18 |
|
19 |
BASE_DIR: Path = Path(__file__).parent.parent.parent
|
20 |
+
RESULTS_DIR: Path = BASE_DIR / "results"
|
21 |
LOG_DIR: Path = BASE_DIR / "logs"
|
22 |
+
AUDIO_FILE_PATH: Path = RESULTS_DIR / f"{CURRENT_DATE}.wav"
|
23 |
LOG_FILE_PATH: Path = LOG_DIR / f"{CURRENT_DATE}.log"
|
24 |
|
25 |
RESULTS_DIR.mkdir(exist_ok=True)
|
26 |
LOG_DIR.mkdir(exist_ok=True)
|
27 |
|
28 |
CUDA_AVAILABLE: bool = cuda.is_available()
|
29 |
+
logger.add(
|
30 |
+
LOG_FILE_PATH,
|
31 |
+
format="{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}",
|
32 |
+
colorize=True,
|
33 |
+
)
|
34 |
logger.info(f"CUDA Available: {CUDA_AVAILABLE}")
|
35 |
logger.info(f"Char limit: {CHAR_LIMIT}")
|
36 |
logger.info(f"Base directory: {BASE_DIR}")
|