Update src/streamlit_app.py
Browse files- src/streamlit_app.py +19 -4
src/streamlit_app.py
CHANGED
|
@@ -1,5 +1,20 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from huggingface_hub import hf_hub_download , snapshot_download
|
| 2 |
+
import importlib
|
| 3 |
|
| 4 |
+
# snapshot_downloading your private space
|
| 5 |
+
snapshot_download(
|
| 6 |
+
repo_id="/ghodrat/app",
|
| 7 |
+
repo_type="space",
|
| 8 |
+
cache_dir="cache-dir"
|
| 9 |
+
)
|
| 10 |
+
# calling the app code
|
| 11 |
+
app = hf_hub_download(
|
| 12 |
+
repo_id="/ghodrat/app",
|
| 13 |
+
filename="app.py",
|
| 14 |
+
repo_type="space"
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
# executing the app file
|
| 18 |
+
spec_app = importlib.util.spec_from_file_location("*",app_path)
|
| 19 |
+
app = importlib.util.module_from_spec(spec_app)
|
| 20 |
+
spec_app.loader.exec_module(app)
|