mirror of
https://github.com/serp-ai/bark-with-voice-clone.git
synced 2025-12-16 11:48:09 +01:00
add suggestions from code review
This commit is contained in:
@@ -165,9 +165,8 @@ def _grab_best_device(use_gpu=True):
|
|||||||
def _download(from_hf_path, file_name, to_local_path):
|
def _download(from_hf_path, file_name, to_local_path):
|
||||||
os.makedirs(CACHE_DIR, exist_ok=True)
|
os.makedirs(CACHE_DIR, exist_ok=True)
|
||||||
destination_file_name = to_local_path.split("/")[-1]
|
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=CACHE_DIR)
|
||||||
hf_hub_download(repo_id=from_hf_path, filename=file_name, local_dir=file_dir)
|
os.replace(os.path.join(CACHE_DIR, file_name), to_local_path)
|
||||||
os.replace(f"{CACHE_DIR}/{file_name}", to_local_path)
|
|
||||||
|
|
||||||
class InferenceContext:
|
class InferenceContext:
|
||||||
def __init__(self, benchmark=False):
|
def __init__(self, benchmark=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user