From b24dd26d4b18e355c5a425bec794b30216d1d86e Mon Sep 17 00:00:00 2001 From: Vaibhav Srivastav Date: Fri, 28 Apr 2023 16:26:09 +0200 Subject: [PATCH] add suggestions from code review --- bark/generation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bark/generation.py b/bark/generation.py index 842b890..f6980cc 100644 --- a/bark/generation.py +++ b/bark/generation.py @@ -165,9 +165,8 @@ def _grab_best_device(use_gpu=True): def _download(from_hf_path, file_name, to_local_path): os.makedirs(CACHE_DIR, exist_ok=True) destination_file_name = to_local_path.split("/")[-1] - file_dir = CACHE_DIR - hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=file_dir) - os.replace(f"{CACHE_DIR}/{file_name}", to_local_path) + hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=CACHE_DIR) + os.replace(os.path.join(CACHE_DIR, file_name), to_local_path) class InferenceContext: def __init__(self, benchmark=False):