BBrother commited on
Commit
d2a6e99
·
1 Parent(s): 424717e

Upload extensions/sd-webui-prompt-all-in-one/install.py with huggingface_hub

Browse files
extensions/sd-webui-prompt-all-in-one/install.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import launch
2
+
3
+ packages = {
4
+ "chardet": "chardet",
5
+ "fastapi": "fastapi",
6
+ "execjs": "PyExecJS",
7
+ "lxml": "lxml",
8
+ "tqdm": "tqdm",
9
+ "pathos": "pathos",
10
+ "cryptography": "cryptography",
11
+
12
+ # The following packages are required for translation service. If you do not need translation service, you can remove them.
13
+ # 以下是翻译所需的包,如果不需要翻译服务,可以删除掉它们。
14
+ "openai": "openai",
15
+ "boto3": "boto3",
16
+ "aliyunsdkcore": "aliyun-python-sdk-core",
17
+ "aliyunsdkalimt": "aliyun-python-sdk-alimt",
18
+ }
19
+
20
+ if __name__ == "__main__":
21
+ for package_name in packages:
22
+ package = packages[package_name]
23
+ try:
24
+ if not launch.is_installed(package_name):
25
+ launch.run_pip(f"install {package}", f"sd-webui-prompt-all-in-one: {package_name}")
26
+ except Exception as e:
27
+ print(e)
28
+ print(f'Warning: Failed to install {package}, some preprocessors may not work.')