Skip to content

Commit

Permalink
Update infer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNeodev authored Dec 17, 2024
1 parent ac2c2e0 commit e523531
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rvc_inferpy/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ def get_model(voice_model):
)


BASE_DIR = Path(os.getcwd()) # Use Path for better path handling
sys.path.append(str(BASE_DIR)) # Corrected to use BASE_DIR
BASE_DIR = Path(os.getcwd())
sys.path.append(str(BASE_DIR))

files_to_check = ["hubert_base.pt", "rmvpe.pt", "fcpe.pt"]

# Check for missing files
missing_files = [file for file in files_to_check if not (BASE_DIR / file).exists()]


# Define the download function
def dl_model(link, model_name, dir_name):
url = f"{link}/{model_name}"
response = requests.get(url, stream=True)
Expand All @@ -104,7 +102,6 @@ def dl_model(link, model_name, dir_name):
print(f"{model_name} downloaded successfully!")


# Download missing files if any
if missing_files:
RVC_DOWNLOAD_LINK = "https://huggingface.co/theNeofr/rvc-base/resolve/main" # Replace with the actual download link

Expand All @@ -114,8 +111,7 @@ def dl_model(link, model_name, dir_name):

print("All missing models have been downloaded!")
else:
print("All required files are already present.")

pass

def infer_audio(
model_name,
Expand Down

0 comments on commit e523531

Please sign in to comment.