jiangzeyinzi commited on
Commit
7edac98
1 Parent(s): 6ef6757
app.py CHANGED
@@ -5,8 +5,8 @@ import os
5
  # print(f"pip3 uninstall gradio")
6
  # results = os.popen(f"pip3 uninstall gradio -y")
7
  # print(results.readlines())
8
- results = os.popen(f"ls -lR ~/.cache/huggingface/hub")
9
- print("step0:", results.readlines())
10
  results = os.popen(f"pip3 install -r requirements.txt -i https://pypi.org/simple")
11
  print("step1:", results.readlines())
12
  results = os.popen(f"pip3 uninstall scepter -y")
@@ -15,8 +15,8 @@ results = os.popen(f"pip3 install scepter -i https://pypi.org/simple")
15
  print("step3:", results.readlines())
16
  results = os.popen(f"pip3 list")
17
  print("step4:", results.readlines())
18
- results = os.popen(f"sudo chmod 777 /data")
19
- print("step5:", results.readlines())
20
  print("finish install")
21
 
22
  import random
@@ -27,6 +27,29 @@ from scepter.modules.utils.config import Config
27
  from scepter.modules.utils.file_system import FS
28
  from scepter.modules.utils.logger import get_logger, init_logger
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  def prepare(config):
32
  if 'FILE_SYSTEM' in config:
@@ -109,4 +132,4 @@ with gr.Blocks() as demo:
109
  for interface, label, ifid in interfaces:
110
  interface.set_callbacks(tab_manager)
111
 
112
- demo.queue(status_update_rate=1, api_open=False).launch(share=False, show_error=True, enable_queue=True)
 
5
  # print(f"pip3 uninstall gradio")
6
  # results = os.popen(f"pip3 uninstall gradio -y")
7
  # print(results.readlines())
8
+ # results = os.popen(f"ls -lR ~/.cache/huggingface/hub")
9
+ # print("step0:", results.readlines())
10
  results = os.popen(f"pip3 install -r requirements.txt -i https://pypi.org/simple")
11
  print("step1:", results.readlines())
12
  results = os.popen(f"pip3 uninstall scepter -y")
 
15
  print("step3:", results.readlines())
16
  results = os.popen(f"pip3 list")
17
  print("step4:", results.readlines())
18
+ #results = os.popen(f"sudo chmod 777 /data")
19
+ #print("step5:", results.readlines())
20
  print("finish install")
21
 
22
  import random
 
27
  from scepter.modules.utils.file_system import FS
28
  from scepter.modules.utils.logger import get_logger, init_logger
29
 
30
+ def link_model():
31
+ import os
32
+ ms_root_dir = "cache/cache_data/"
33
+ hf_root_dir = "/home/user/.cache/huggingface/hub/"
34
+ # hf_root_dir = "/root/.cache/huggingface/hub/"
35
+ model_map = {
36
+ "95c8c1dcca842facbdcb9606c314f7ae/AI-ModelScope/stable-diffusion-v1-5": "models--runwayml--stable-diffusion-v1-5/snapshots/1d0c4ebf6ff58a5caecab40fa1406526bca4b5b9",
37
+ "601abc72ccca722467955bb9c36da4b3/AI-ModelScope/stable-diffusion-2-1": "models--stabilityai--stable-diffusion-2-1/snapshots/5cae40e6a2745ae2b01ad92ae5043f95f23644d6",
38
+ "76ee531623cf180d9c98a6fbf5fa0c45.0/AI-ModelScope/stable-diffusion-xl-base-1.0": "models--stabilityai--stable-diffusion-xl-base-1.0/snapshots/462165984030d82259a11f4367a4eed129e94a7b",
39
+ "37fb512464d701519e3be1d14c97f8c0/AI-ModelScope/clip-vit-large-patch14": "models--openai--clip-vit-large-patch14/snapshots/32bd64288804d66eefd0ccbe215aa642df71cc41",
40
+ "c2412c56551dfb7baa71c84978ee22eb/iic/scepter": "models--scepter-studio--scepter/snapshots/d78fd86694550622e1d256865fe444282fcccb19",
41
+ "d5bec966515f3501f44f4844c8f8e5cb/iic/scepter_scedit": "models--scepter-studio--scepter_scedit/snapshots/c8905ae6dda1ebafd2db20261ebe98cf0d9a2cd1",
42
+ "578c6574e9925c75f1ae50888bf65ccb/damo/LARGEN": "models--scepter-studio--LAR-Gen/snapshots/7ab4b7d934d60ed80600f2971fa0c4004ba17b4d",
43
+ "b2e04aa8710d90c9486f14465c543e83/damo/stylebooth": "models--scepter-studio--stylebooth/snapshots/c993df593ed451c137118b5426a1dcab29e38d5c",
44
+ "7168a5d7e0eb13ef4facee9a8d2da34c/cubeai/blip-image-captioning-base": "models--Salesforce--blip-image-captioning-base/snapshots/89b09ea1789f7addf2f6d6f0dfc4ce10ab58ef84"
45
+ }
46
+ for ms_name, hf_name in model_map.items():
47
+ ms_path =os.path.join(ms_root_dir, ms_name)
48
+ hf_path = os.path.join(hf_root_dir, hf_name)
49
+ cmd = f"mkdir -p {ms_path} && ln -s {hf_path}/* {ms_path}"
50
+ os.system(cmd)
51
+
52
+ link_model()
53
 
54
  def prepare(config):
55
  if 'FILE_SYSTEM' in config:
 
132
  for interface, label, ifid in interfaces:
133
  interface.set_callbacks(tab_manager)
134
 
135
+ demo.queue(status_update_rate=1, api_open=False).launch(share=False, show_error=True, enable_queue=True)
cache/cache_data/37fb512464d701519e3be1d14c97f8c0/AI-ModelScope/clip-vit-large-patch14/.msc ADDED
Binary file (935 Bytes). View file
 
cache/cache_data/578c6574e9925c75f1ae50888bf65ccb/damo/LARGEN/.msc ADDED
Binary file (1.51 kB). View file
 
cache/cache_data/601abc72ccca722467955bb9c36da4b3/AI-ModelScope/stable-diffusion-2-1/.msc ADDED
Binary file (114 Bytes). View file
 
cache/cache_data/7168a5d7e0eb13ef4facee9a8d2da34c/cubeai/blip-image-captioning-base/.msc ADDED
Binary file (662 Bytes). View file
 
cache/cache_data/76ee531623cf180d9c98a6fbf5fa0c45.0/AI-ModelScope/stable-diffusion-xl-base-1.0/.msc ADDED
Binary file (109 Bytes). View file
 
cache/cache_data/95c8c1dcca842facbdcb9606c314f7ae/AI-ModelScope/stable-diffusion-v1-5/.msc ADDED
Binary file (114 Bytes). View file
 
cache/cache_data/b2e04aa8710d90c9486f14465c543e83/damo/stylebooth/.msc ADDED
Binary file (114 Bytes). View file
 
cache/cache_data/c2412c56551dfb7baa71c84978ee22eb/iic/scepter/.msc ADDED
Binary file (365 Bytes). View file
 
cache/cache_data/d5bec966515f3501f44f4844c8f8e5cb/iic/scepter_scedit/.msc ADDED
Binary file (27.1 kB). View file