Spaces:
Sleeping
Sleeping
Delete run_seed_v2.py with huggingface_hub
Browse files- run_seed_v2.py +0 -27
run_seed_v2.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import sys
|
| 3 |
-
|
| 4 |
-
# Add the current directory to sys.path so we can import 'app'
|
| 5 |
-
sys.path.insert(0, os.path.join(os.getcwd(), "app"))
|
| 6 |
-
sys.path.insert(0, os.getcwd())
|
| 7 |
-
|
| 8 |
-
from app.db.base import SessionLocal
|
| 9 |
-
from app.api.seed import seed_database
|
| 10 |
-
|
| 11 |
-
def run():
|
| 12 |
-
print(">>> [LAUNCHER] Starting Hierarchical Seeding...")
|
| 13 |
-
db = SessionLocal()
|
| 14 |
-
try:
|
| 15 |
-
# Clear=True ensures a professional "From Scratch" reset
|
| 16 |
-
response = seed_database(clear=True, db=db)
|
| 17 |
-
print(">>> [LAUNCHER] Seeding Complete!")
|
| 18 |
-
print(f">>> Result: {response.value}")
|
| 19 |
-
except Exception as e:
|
| 20 |
-
print(f">>> [LAUNCHER] ERROR during seeding: {e}")
|
| 21 |
-
import traceback
|
| 22 |
-
traceback.print_exc()
|
| 23 |
-
finally:
|
| 24 |
-
db.close()
|
| 25 |
-
|
| 26 |
-
if __name__ == "__main__":
|
| 27 |
-
run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|