Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mrfakename
commited on
Commit
•
3c7f052
1
Parent(s):
434d289
Update app.py
Browse files
app.py
CHANGED
@@ -203,8 +203,7 @@ def sync_db():
|
|
203 |
token=os.getenv('HF_TOKEN')
|
204 |
)
|
205 |
while True:
|
206 |
-
|
207 |
-
time.sleep(30)
|
208 |
print("Uploading DB")
|
209 |
api.upload_file(
|
210 |
path_or_fileobj='database.db',
|
@@ -221,6 +220,7 @@ if os.getenv('DATASET_ID'):
|
|
221 |
api = HfApi(
|
222 |
token=os.getenv('HF_TOKEN')
|
223 |
)
|
|
|
224 |
try:
|
225 |
api.hf_hub_download(
|
226 |
repo_id=os.getenv('DATASET_ID'),
|
@@ -228,6 +228,7 @@ if os.getenv('DATASET_ID'):
|
|
228 |
filename='database.db',
|
229 |
cache_dir='./'
|
230 |
)
|
|
|
231 |
except:
|
232 |
pass
|
233 |
# Update DB
|
|
|
203 |
token=os.getenv('HF_TOKEN')
|
204 |
)
|
205 |
while True:
|
206 |
+
time.sleep(60 * 15)
|
|
|
207 |
print("Uploading DB")
|
208 |
api.upload_file(
|
209 |
path_or_fileobj='database.db',
|
|
|
220 |
api = HfApi(
|
221 |
token=os.getenv('HF_TOKEN')
|
222 |
)
|
223 |
+
print("Downloading DB...")
|
224 |
try:
|
225 |
api.hf_hub_download(
|
226 |
repo_id=os.getenv('DATASET_ID'),
|
|
|
228 |
filename='database.db',
|
229 |
cache_dir='./'
|
230 |
)
|
231 |
+
print("Downloaded DB")
|
232 |
except:
|
233 |
pass
|
234 |
# Update DB
|