Spaces:
Sleeping
Sleeping
Update requirements.txt
Browse files- requirements.txt +14 -0
requirements.txt
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
transformers>=4.44.0
|
| 2 |
torch>=2.1.0
|
| 3 |
gradio>=4.44.0
|
|
|
|
| 1 |
+
import sys, subprocess
|
| 2 |
+
|
| 3 |
+
def _safe_pip_install(pkg_spec: str):
|
| 4 |
+
try:
|
| 5 |
+
__import__(pkg_spec.split("==")[0].replace("-", "_"))
|
| 6 |
+
except ImportError:
|
| 7 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", pkg_spec])
|
| 8 |
+
|
| 9 |
+
# ติดตั้งถ้ายังไม่มี (กันเหนียว)
|
| 10 |
+
_safe_pip_install("yt-dlp==2024.10.07")
|
| 11 |
+
_safe_pip_install("transformers>=4.44.0")
|
| 12 |
+
_safe_pip_install("gradio>=4.44.0")
|
| 13 |
+
_safe_pip_install("spaces>=0.26.0")
|
| 14 |
+
|
| 15 |
transformers>=4.44.0
|
| 16 |
torch>=2.1.0
|
| 17 |
gradio>=4.44.0
|