Spaces:
Sleeping
Sleeping
Ihor Neporozhnii commited on
Commit ·
f4c64a4
1
Parent(s): 0b36466
add cache resource func to clone repo
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from git import Repo
|
|
| 4 |
import streamlit as st
|
| 5 |
st.set_page_config(layout="wide")
|
| 6 |
|
| 7 |
-
@st.
|
| 8 |
def load_repo():
|
| 9 |
if os.path.exists(os.path.dirname(os.path.abspath(__file__))+"/prodosmate/prodosmate_app_repo"):
|
| 10 |
shutil.rmtree(os.path.dirname(os.path.abspath(__file__))+"/prodosmate/prodosmate_app_repo")
|
|
@@ -12,5 +12,6 @@ def load_repo():
|
|
| 12 |
print("cloning...")
|
| 13 |
Repo.clone_from(f"https://ineporozhnii:{os.environ['PDOS_FINGERPRINTS_APP_TOKEN']}@github.com/ineporozhnii/pdos_fingerprints_app_hugging_face.git", "prodosmate/prodosmate_app_repo")
|
| 14 |
|
|
|
|
| 15 |
from prodosmate.prodosmate_app_repo.main import run_application
|
| 16 |
run_application()
|
|
|
|
| 4 |
import streamlit as st
|
| 5 |
st.set_page_config(layout="wide")
|
| 6 |
|
| 7 |
+
@st.cache_resource
|
| 8 |
def load_repo():
|
| 9 |
if os.path.exists(os.path.dirname(os.path.abspath(__file__))+"/prodosmate/prodosmate_app_repo"):
|
| 10 |
shutil.rmtree(os.path.dirname(os.path.abspath(__file__))+"/prodosmate/prodosmate_app_repo")
|
|
|
|
| 12 |
print("cloning...")
|
| 13 |
Repo.clone_from(f"https://ineporozhnii:{os.environ['PDOS_FINGERPRINTS_APP_TOKEN']}@github.com/ineporozhnii/pdos_fingerprints_app_hugging_face.git", "prodosmate/prodosmate_app_repo")
|
| 14 |
|
| 15 |
+
load_repo()
|
| 16 |
from prodosmate.prodosmate_app_repo.main import run_application
|
| 17 |
run_application()
|