Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
fix: clean libtcmalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Linaqruf committed Jul 19, 2023
1 parent 05b49c2 commit bfb0db4
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions cagliostro-colab-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"dpmpp_2m_v2_patch = True # @param {type:'boolean'}\n",
"# @markdown ### **Optimization Config**\n",
"# @markdown > It's not recommended to set params below to `True` if you have **Colab Pro** subscription.\n",
"ram_alloc_patch = True # @param {type:'boolean'}\n",
"colab_optimizations = True # @param {type:'boolean'}\n",
"# @markdown > Specify `mobile_optimizations` to keep colab tab alive for mobile users\n",
"mobile_optimizations = False # @param {type:'boolean'}\n",
Expand Down Expand Up @@ -198,14 +197,9 @@
" subprocess.run(['pip', 'install', '-q', f'xformers=={xformers_version}'], check=True)\n",
"\n",
"def install_dependencies():\n",
" ubuntu_deps_url = \"https://huggingface.co/Linaqruf/fast-repo/resolve/main/ubuntu-deps.zip\"\n",
" ram_patch_url = \"https://huggingface.co/Linaqruf/fast-repo/resolve/main/ram_patch.zip\"\n",
"\n",
" ubuntu_deps(ubuntu_deps_url, deps_dir, cprint(\"Installing ubuntu dependencies\", color=\"green\", tqdm_desc=True))\n",
"\n",
" if ram_alloc_patch:\n",
" subprocess.run([\"apt\", \"install\", 'libunwind8-dev', \"-y\"], check=True)\n",
" ubuntu_deps(ram_patch_url, deps_dir, cprint(\"Installing RAM allocation patch\", color=\"green\", tqdm_desc=True))\n",
" ubuntu_deps = [\"aria2\", \"lz4\", \"unionfs-fuse\"]\n",
" cprint(\"Installing ubuntu dependencies\", color=\"green\")\n",
" subprocess.run([\"apt\", \"install\"] + ubuntu_deps)\n",
"\n",
"def install_webui(repo_dir, desc):\n",
" try:\n",
Expand Down Expand Up @@ -305,10 +299,6 @@
" shutil.rmtree(patches_dir)\n",
" cprint(\" [-] DPM++ 2m V2 and DPM++ 2m Karras V2 patch done!\", color=\"green\")\n",
"\n",
" if ram_alloc_patch:\n",
" os.environ[\"LD_PRELOAD\"] = \"libtcmalloc.so\"\n",
" cprint(\" [-] Camenduru's ram allocation patch done!\", color=\"green\")\n",
"\n",
" if colab_optimizations:\n",
" lowram_patch_url = \"https://raw.githubusercontent.com/ddPn08/automatic1111-colab/main/patches/stablediffusion-lowram.patch\"\n",
" stable_diffusion_repo_dir = os.path.join(repo_dir, \"repositories/stable-diffusion-stability-ai\")\n",
Expand Down Expand Up @@ -1074,7 +1064,7 @@
"\n",
"os.chdir(output_dir)\n",
"\n",
"use_drive = True # @param {type:\"boolean\"}\n",
"use_drive = False # @param {type:\"boolean\"}\n",
"folder_name = \"cagliostro-colab-ui\" # @param {type: \"string\"}\n",
"filename = \"waifu.zip\" # @param {type: \"string\"}\n",
"save_as = filename\n",
Expand Down

0 comments on commit bfb0db4

Please sign in to comment.