|
import os |
|
import subprocess |
|
import sys |
|
|
|
|
|
|
|
repo_dir = "VibeVoice" |
|
if not os.path.exists(repo_dir): |
|
print("Cloning the VibeVoice repository...") |
|
try: |
|
subprocess.run( |
|
["git", "clone", "https://github.com/microsoft/VibeVoice.git"], |
|
check=True, |
|
capture_output=True, |
|
text=True |
|
) |
|
print("Repository cloned successfully.") |
|
except subprocess.CalledProcessError as e: |
|
print(f"Error cloning repository: {e.stderr}") |
|
sys.exit(1) |
|
else: |
|
print("Repository already exists. Skipping clone.") |
|
|
|
|
|
|
|
os.chdir(repo_dir) |
|
print(f"Changed directory to: {os.getcwd()}") |
|
|
|
print("Installing the VibeVoice package...") |
|
try: |
|
|
|
subprocess.run( |
|
[sys.executable, "-m", "pip", "install", "-e", "."], |
|
check=True, |
|
capture_output=True, |
|
text=True |
|
) |
|
print("Package installed successfully.") |
|
except subprocess.CalledProcessError as e: |
|
print(f"Error installing package: {e.stderr}") |
|
sys.exit(1) |
|
|
|
|
|
|
|
demo_script_path = "demo/gradio_demo.py" |
|
model_id = "microsoft/VibeVoice-1.5B" |
|
|
|
|
|
|
|
command = [ |
|
"python", |
|
demo_script_path, |
|
"--model_path", |
|
model_id, |
|
"--share" |
|
] |
|
|
|
print(f"Launching Gradio demo with command: {' '.join(command)}") |
|
|
|
|
|
subprocess.run(command) |