AI-RABBIT commited on
Commit
a461e82
·
verified ·
1 Parent(s): 5a69d56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import os
2
- import git
3
- import subprocess
4
  import sys
 
5
  import gradio as gr
6
  import torch
7
  from huggingface_hub import hf_hub_download
@@ -15,11 +14,10 @@ if not os.path.exists(repo_dir):
15
  print("Cloning cog-sdxl repository...")
16
  git.Repo.clone_from(repo_url, repo_dir)
17
 
18
- # Install the cog-sdxl repository locally
19
- print("Installing cog-sdxl package...")
20
- subprocess.check_call([sys.executable, "-m", "pip", "install", "-e", repo_dir])
21
 
22
- # Now import the required module after it has been installed
23
  from cog_sdxl.dataset_and_utils import TokenEmbeddingsHandler
24
 
25
  # Load the model pipeline
 
1
  import os
 
 
2
  import sys
3
+ import git
4
  import gradio as gr
5
  import torch
6
  from huggingface_hub import hf_hub_download
 
14
  print("Cloning cog-sdxl repository...")
15
  git.Repo.clone_from(repo_url, repo_dir)
16
 
17
+ # Add cog_sdxl directory to sys.path for imports
18
+ sys.path.append(os.path.abspath(repo_dir))
 
19
 
20
+ # Now import the required module after adding cog_sdxl to sys.path
21
  from cog_sdxl.dataset_and_utils import TokenEmbeddingsHandler
22
 
23
  # Load the model pipeline