-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.windows.py
45 lines (35 loc) · 1.44 KB
/
build.windows.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
import urllib.request
import json
def install_latest(repo, branch="master"):
# Clone the repository
os.system(f'Z:\\cmd\\git.exe clone https://github.com/{repo}.git')
# Change directory to the cloned repository
repo_name = repo.split('/')[-1]
os.chdir(repo_name)
# Fetch all the tags in the repository
os.system('Z:\\cmd\\git.exe fetch --tags')
# Get the latest tag on the specified branch or on all branches
os.system(f'Z:\\cmd\\git.exe checkout {branch}')
tags = os.popen('Z:\\cmd\\git.exe tag --merged').read().splitlines()
latest_tag = None
for tag in tags:
if branch is None or tag.startswith(f'v{branch}-'):
if latest_tag is None or tag > latest_tag:
latest_tag = tag
if latest_tag:
latest_tag = latest_tag.strip()
# Switch to the latest tag
os.system(f'Z:\\cmd\\git.exe checkout {latest_tag}')
# Install the package
os.system(f'C:\\Python310\\python.exe -m pip install .')
def clone(repo):
# clone repo into /app
os.system(f'Z:\\cmd\\git.exe clone https://github.com/{repo}.git /app/{repo.split("/")[1]}')
# remove diffusers
os.system("C:\\Python310\\python.exe -m pip uninstall diffusers -y")
# install repos
install_latest("w4ffl35/diffusers")
install_latest("w4ffl35/transformers")
install_latest("Capsize-Games/chatai", branch="develop-windows")
os.system("C:\\Python310\\python.exe -m pip install bitsandbytes-cuda102")