Spaces:
Running
Running
柿崎透真
commited on
Commit
·
0bda4a9
1
Parent(s):
ce4ae6b
インストール方法変更
Browse files- app.py +10 -0
- requirements.txt +1 -2
app.py
CHANGED
|
@@ -3,9 +3,19 @@ from huggingface_hub import HfApi
|
|
| 3 |
from tempfile import TemporaryDirectory
|
| 4 |
import importlib.util
|
| 5 |
import sys
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def load_private_code():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
api = HfApi(token=os.environ["PRIVATE_REPOSITORY_HF_TOKEN"])
|
| 10 |
|
| 11 |
with TemporaryDirectory() as tmp_dir:
|
|
|
|
| 3 |
from tempfile import TemporaryDirectory
|
| 4 |
import importlib.util
|
| 5 |
import sys
|
| 6 |
+
import subprocess
|
| 7 |
|
| 8 |
|
| 9 |
def load_private_code():
|
| 10 |
+
token = os.environ.get("TOKEN", "")
|
| 11 |
+
if token:
|
| 12 |
+
try:
|
| 13 |
+
subprocess.run(
|
| 14 |
+
["pip", "install", f"git+https://{token}@github.com/neoAI-inc/[email protected]"],
|
| 15 |
+
check=True
|
| 16 |
+
)
|
| 17 |
+
except subprocess.CalledProcessError as e:
|
| 18 |
+
print("Error installing private module:", e)
|
| 19 |
api = HfApi(token=os.environ["PRIVATE_REPOSITORY_HF_TOKEN"])
|
| 20 |
|
| 21 |
with TemporaryDirectory() as tmp_dir:
|
requirements.txt
CHANGED
|
@@ -12,5 +12,4 @@ setuptools>=75.3.0
|
|
| 12 |
opencv-python>=4.10.0.84
|
| 13 |
vertexai>=1.71.1
|
| 14 |
azure-identity>=1.16.0
|
| 15 |
-
azure-search-documents>=11.4.0
|
| 16 |
-
git+https://${TOKEN}@github.com/neoAI-inc/[email protected]
|
|
|
|
| 12 |
opencv-python>=4.10.0.84
|
| 13 |
vertexai>=1.71.1
|
| 14 |
azure-identity>=1.16.0
|
| 15 |
+
azure-search-documents>=11.4.0
|
|
|