|
34 | 34 | }, |
35 | 35 | "outputs": [], |
36 | 36 | "source": [ |
| 37 | + "#@title ## **Install**\n", |
| 38 | + "!sudo apt update\n", |
| 39 | + "!sudo apt install python3.10\n", |
| 40 | + "!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1\n", |
| 41 | + "!sudo update-alternatives --set python3 /usr/bin/python3.10\n", |
| 42 | + "!curl -sS https://bootstrap.pypa.io/get-pip.py | python3\n", |
| 43 | + "import sys\n", |
| 44 | + "sys.path.append('/usr/local/lib/python3.10/dist-packages')\n", |
37 | 45 | "\n", |
38 | | - "#@title ## **Setup and Installation**\n", |
39 | 46 | "import os\n", |
40 | | - "import subprocess\n", |
41 | 47 | "import codecs\n", |
42 | | - "\n", |
43 | | - "def run_command(command, error_message, capture_output=True):\n", |
44 | | - " \"\"\"Runs a shell command and handles errors.\"\"\"\n", |
45 | | - " try:\n", |
46 | | - " result = subprocess.run(command, shell=True, text=True, capture_output=capture_output, check=True)\n", |
47 | | - " if capture_output:\n", |
48 | | - " return result.stdout.strip()\n", |
49 | | - " except subprocess.CalledProcessError as e:\n", |
50 | | - " print(f\"❌ {error_message}: {e.stderr.strip() if e.stderr else 'No details available'}\")\n", |
51 | | - " raise\n", |
52 | | - "\n", |
53 | | - "def main():\n", |
54 | | - " print(\"🚀: Initializing setup...\")\n", |
55 | | - "\n", |
56 | | - " # Decode repository URL\n", |
57 | | - " repo_url = codecs.decode(\"uggcf://tvguho.pbz/NexnaQnfu/Nqinaprq-EIP-Vasrerapr.tvg\", \"rot_13\")\n", |
58 | | - "\n", |
59 | | - " # Clone repository\n", |
60 | | - " print(\"📥: Cloning repository...\")\n", |
61 | | - " run_command(f\"git clone {repo_url} main_program\", \"Failed to clone repository\")\n", |
62 | | - "\n", |
63 | | - " # Change directory\n", |
64 | | - " os.chdir(\"main_program\")\n", |
65 | | - "\n", |
66 | | - " # Install UV package manager\n", |
67 | | - " print(\"📦: Installing UV package manager...\")\n", |
68 | | - " run_command(\"pip install uv\", \"Failed to install UV\")\n", |
69 | | - "\n", |
70 | | - " # Create and activate virtual environment\n", |
71 | | - " print(\"🔧: Setting up virtual environment...\")\n", |
72 | | - " run_command(\"uv venv .venv\", \"Failed to create virtual environment\")\n", |
73 | | - "\n", |
74 | | - " # Install dependencies\n", |
75 | | - " print(\"📌: Installing dependencies...\")\n", |
76 | | - " run_command(\"uv pip install --no-deps -r requirements.txt\", \"Failed to install dependencies\")\n", |
77 | | - "\n", |
78 | | - " # Install PyTorch with CUDA support\n", |
79 | | - " print(\"🔥: Installing PyTorch (CUDA 12.1)...\")\n", |
80 | | - " run_command(\"uv pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --upgrade --index-url https://download.pytorch.org/whl/cu121\",\n", |
81 | | - " \"Failed to install PyTorch\")\n", |
82 | | - "\n", |
83 | | - " # Ensure correct NumPy version\n", |
84 | | - " print(\"🔢: Installing NumPy 1.23.5...\")\n", |
85 | | - " run_command(\"uv pip install numpy==1.23.5\", \"Failed to install NumPy\")\n", |
86 | | - "\n", |
87 | | - " # Install pyngrok for tunneling\n", |
88 | | - " print(\"🌐: Installing pyngrok...\")\n", |
89 | | - " run_command(\"pip install pyngrok\", \"Failed to install pyngrok\")\n", |
90 | | - "\n", |
91 | | - " # Run prerequisite download script\n", |
92 | | - " print(\"🔄: Downloading prerequisites...\")\n", |
93 | | - " run_command(\"source .venv/bin/activate; python programs/applio_code/rvc/lib/tools/prerequisites_download.py\",\n", |
94 | | - " \"Failed to execute prerequisites script\")\n", |
95 | | - "\n", |
96 | | - " print(\"✅: Setup complete! All requirements installed successfully.\")\n", |
97 | | - "\n", |
98 | | - "if __name__ == \"__main__\":\n", |
99 | | - " main()" |
| 48 | + "from IPython.display import clear_output\n", |
| 49 | + "print(\"Installing requirements\")\n", |
| 50 | + "repo = \"https://github.com/ArkanDash/Advanced-RVC-Inference.git\"\n", |
| 51 | + "\n", |
| 52 | + "\n", |
| 53 | + "!git clone $repo main_program &> /dev/null\n", |
| 54 | + "%cd main_program\n", |
| 55 | + "!pip install uv &> /dev/null\n", |
| 56 | + "!uv venv .venv --python 3.10.12 &> /dev/null\n", |
| 57 | + "!uv pip install --no-deps -r requirements.txt &> /dev/null\n", |
| 58 | + "!uv pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --upgrade --index-url https://download.pytorch.org/whl/cu121 &> /dev/null\n", |
| 59 | + "!uv pip install numpy==1.23.5 &> /dev/null\n", |
| 60 | + "!pip install pyngrok &> /dev/null\n", |
| 61 | + "!pip install tqdm &> /dev/null\n", |
| 62 | + "!source .venv/bin/activate\n", |
| 63 | + "!python programs/applio_code/rvc/lib/tools/prerequisites_download.py\n", |
| 64 | + "clear_output()\n", |
| 65 | + "print(\"Requirements installed!\")" |
100 | 66 | ] |
101 | 67 | }, |
102 | 68 | { |
|
0 commit comments