ACCC1380 commited on
Commit
c46db52
1 Parent(s): b567ecc

Upload lora-scripts/install-cn.ps1 with huggingface_hub

Browse files
Files changed (1) hide show
  1. lora-scripts/install-cn.ps1 +48 -0
lora-scripts/install-cn.ps1 ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $Env:HF_HOME = "huggingface"
2
+ $Env:PIP_DISABLE_PIP_VERSION_CHECK = 1
3
+ $Env:PIP_NO_CACHE_DIR = 1
4
+ $Env:PIP_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple"
5
+ function InstallFail {
6
+ Write-Output "��װʧ�ܡ�"
7
+ Read-Host | Out-Null ;
8
+ Exit
9
+ }
10
+
11
+ function Check {
12
+ param (
13
+ $ErrorInfo
14
+ )
15
+ if (!($?)) {
16
+ Write-Output $ErrorInfo
17
+ InstallFail
18
+ }
19
+ }
20
+
21
+ if (!(Test-Path -Path "venv")) {
22
+ Write-Output "���ڴ������⻷��..."
23
+ python -m venv venv
24
+ Check "�������⻷��ʧ�ܣ����� python �Ƿ�װ����Լ� python �汾�Ƿ�Ϊ64λ�汾��python 3.10����python��Ŀ¼�Ƿ��ڻ�������PATH�ڡ�"
25
+ }
26
+
27
+ .\venv\Scripts\activate
28
+ Check "�������⻷��ʧ�ܡ�"
29
+
30
+ Set-Location .\sd-scripts
31
+ Write-Output "��װ������������ (�ѽ��й��ڼ��٣����ڹ�����޷�ʹ�ü���Դ�뻻�� install.ps1 �ű�)"
32
+ $install_torch = Read-Host "�Ƿ���Ҫ��װ Torch+xformers? [y/n] (Ĭ��Ϊ y)"
33
+ if ($install_torch -eq "y" -or $install_torch -eq "Y" -or $install_torch -eq ""){
34
+ pip install torch==2.2.1+cu118 torchvision==0.17.1+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html
35
+ Check "torch ��װʧ�ܣ���ɾ�� venv �ļ��к��������С�"
36
+ pip install -U -I --no-deps xformers==0.0.25+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html
37
+ Check "xformers ��װʧ�ܡ�"
38
+ }
39
+
40
+ pip install --upgrade -r requirements.txt
41
+ Check "sd-scripts ������װʧ�ܡ�"
42
+
43
+ Set-Location ..
44
+ pip install --upgrade -r requirements.txt
45
+ Check "ѵ������������װʧ�ܡ�"
46
+
47
+ Write-Output "��װ���"
48
+ Read-Host | Out-Null ;