Update bootstrap.py
Browse files- bootstrap.py +4 -3
bootstrap.py
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
|
|
| 1 |
"""Runtime dependency fixes. Import this FIRST in app.py."""
|
| 2 |
import subprocess, sys, site
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
-
#
|
| 6 |
subprocess.run(
|
| 7 |
[sys.executable, "-m", "pip", "install",
|
| 8 |
"--no-cache-dir", "--upgrade", "--no-deps",
|
| 9 |
-
"gradio
|
| 10 |
check=True,
|
| 11 |
)
|
| 12 |
|
| 13 |
-
#
|
| 14 |
for _root in (*site.getsitepackages(), site.getusersitepackages()):
|
| 15 |
_table = Path(_root) / "transformers" / "dependency_versions_table.py"
|
| 16 |
if _table.exists():
|
|
|
|
| 1 |
+
# bootstrap.py
|
| 2 |
"""Runtime dependency fixes. Import this FIRST in app.py."""
|
| 3 |
import subprocess, sys, site
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
+
# Upgrade gradio + huggingface-hub at runtime after the build succeeds
|
| 7 |
subprocess.run(
|
| 8 |
[sys.executable, "-m", "pip", "install",
|
| 9 |
"--no-cache-dir", "--upgrade", "--no-deps",
|
| 10 |
+
"gradio", "huggingface-hub"],
|
| 11 |
check=True,
|
| 12 |
)
|
| 13 |
|
| 14 |
+
# Relax transformers' hard pin on huggingface-hub<1.0
|
| 15 |
for _root in (*site.getsitepackages(), site.getusersitepackages()):
|
| 16 |
_table = Path(_root) / "transformers" / "dependency_versions_table.py"
|
| 17 |
if _table.exists():
|