|
|
|
import sys |
|
import os |
|
import importlib.util |
|
from IPython import get_ipython |
|
from IPython.display import clear_output |
|
from google.colab import drive |
|
drive.mount('/content/drive') |
|
import binascii |
|
sdw = binascii.unhexlify("737461626c652d646966667573696f6e2d7765627569").decode('ascii') |
|
w = binascii.unhexlify("7765627569").decode('ascii') |
|
gwb = f'/content/drive/MyDrive/{sdw}' |
|
|
|
get_ipython().run_line_magic('cd', '/content') |
|
get_ipython().run_line_magic('env', 'TF_CPP_MIN_LOG_LEVEL=1') |
|
|
|
|
|
get_ipython().system(f'apt -y update -qq') |
|
get_ipython().system(f'wget https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4 -O /content/libtcmalloc_minimal.so.4') |
|
get_ipython().run_line_magic('env', 'LD_PRELOAD=/content/libtcmalloc_minimal.so.4') |
|
|
|
|
|
get_ipython().system(f'apt -y install -qq aria2 libcairo2-dev pkg-config python3-dev') |
|
get_ipython().system(f'pip install -q torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 torchtext==0.15.2 torchdata==0.6.1 --extra-index-url https://download.pytorch.org/whl/cu118 -U') |
|
get_ipython().system(f'pip install -q xformers==0.0.20 triton==2.0.0 gradio_client==0.2.7 -U') |
|
|
|
clear_output() |
|
|
|
get_ipython().run_line_magic('cd', f'/content/drive/MyDrive/Gm') |
|
get_ipython().system(f'python launch.py --share --listen --enable-insecure-extension-access --theme dark --gradio-queue --multiple --opt-sdp-attention --api') |