multimodalart HF Staff commited on
Commit
9cb30ef
·
verified ·
1 Parent(s): e8b92ab

Install bundled diffusers wheel at runtime

Browse files
Files changed (3) hide show
  1. __pycache__/app.cpython-312.pyc +0 -0
  2. app.py +10 -0
  3. requirements.txt +0 -1
__pycache__/app.cpython-312.pyc CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
 
app.py CHANGED
@@ -1,5 +1,15 @@
 
1
  import os
2
  import random
 
 
 
 
 
 
 
 
 
3
 
4
  import spaces
5
  import torch
 
1
+ import glob
2
  import os
3
  import random
4
+ import subprocess
5
+ import sys
6
+
7
+ # The Krea2 pipeline ships as a private diffusers build bundled with this Space.
8
+ # Install it from the local wheel at runtime (the repo files are present here,
9
+ # unlike during the build-time pip step).
10
+ _wheel = glob.glob(os.path.join(os.path.dirname(__file__), "diffusers-*.whl"))
11
+ if _wheel:
12
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-cache-dir", _wheel[0]])
13
 
14
  import spaces
15
  import torch
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
- ./diffusers-0.39.0.dev0-py3-none-any.whl
2
  transformers>=4.57.0
3
  accelerate
4
  sentencepiece
 
 
1
  transformers>=4.57.0
2
  accelerate
3
  sentencepiece