-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.py
31 lines (25 loc) · 953 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import urllib.request
import json
def install_latest(repo):
url = f'https://api.github.com/repos/{repo}/releases/latest'
with urllib.request.urlopen(url) as response:
data = response.read().decode('utf-8')
data = json.loads(data)
tag_name = data["tag_name"]
tar_url = f'https://github.com/{repo}/archive/{tag_name}.tar.gz'
os.system(f'python3 -m pip install {tar_url}')
def clone(repo):
# clone repo into /app
os.system(f'git clone https://github.com/{repo}.git /app/{repo.split("/")[1]}')
# remove diffusers
os.system("python3 -m pip uninstall diffusers -y")
# install repos
install_latest("w4ffl35/diffusers")
install_latest("w4ffl35/transformers")
install_latest("Capsize-Games/aihandler")
os.chdir("/app/chatairunner")
os.system("git checkout master")
os.system("git pull")
os.system("python3 -m pip uninstall nvidia-cublas-cu11 -y")
os.system("python3 -m pip install bitsandbytes-cuda102 -y")