Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Deploy: Consolidated gold tables, fixed nginx docs routing
Browse files- api/main.py +10 -12
api/main.py
CHANGED
|
@@ -199,12 +199,12 @@ from api.routes import contact as contact_routes
|
|
| 199 |
from api.routes import bills_neon as bills_routes # Was: bills
|
| 200 |
from api.database import init_db
|
| 201 |
|
| 202 |
-
app.include_router(auth_routes.router)
|
| 203 |
-
app.include_router(social_routes.router)
|
| 204 |
-
app.include_router(search_routes.router)
|
| 205 |
app.include_router(stats_routes.router, prefix="/api", tags=["stats"])
|
| 206 |
-
app.include_router(contact_routes.router)
|
| 207 |
-
app.include_router(bills_routes.router)
|
| 208 |
|
| 209 |
# Custom Swagger UI with logo
|
| 210 |
@app.get("/docs", include_in_schema=False)
|
|
@@ -1248,19 +1248,17 @@ async def startup_event():
|
|
| 1248 |
logger.info("🤗 VALIDATING HUGGINGFACE DATASETS...")
|
| 1249 |
logger.info("-" * 80)
|
| 1250 |
|
| 1251 |
-
# Check a sample of critical datasets
|
| 1252 |
import requests
|
| 1253 |
-
from api.routes.bills import get_hf_dataset_url
|
| 1254 |
|
| 1255 |
test_datasets = [
|
| 1256 |
-
("
|
| 1257 |
-
("
|
| 1258 |
-
("
|
| 1259 |
]
|
| 1260 |
|
| 1261 |
hf_datasets_ok = 0
|
| 1262 |
-
for
|
| 1263 |
-
url = get_hf_dataset_url(dataset_name)
|
| 1264 |
try:
|
| 1265 |
response = requests.head(url, timeout=10, allow_redirects=True)
|
| 1266 |
if response.status_code == 200:
|
|
|
|
| 199 |
from api.routes import bills_neon as bills_routes # Was: bills
|
| 200 |
from api.database import init_db
|
| 201 |
|
| 202 |
+
app.include_router(auth_routes.router, prefix="/api")
|
| 203 |
+
app.include_router(social_routes.router, prefix="/api")
|
| 204 |
+
app.include_router(search_routes.router, prefix="/api")
|
| 205 |
app.include_router(stats_routes.router, prefix="/api", tags=["stats"])
|
| 206 |
+
app.include_router(contact_routes.router, prefix="/api")
|
| 207 |
+
app.include_router(bills_routes.router, prefix="/api")
|
| 208 |
|
| 209 |
# Custom Swagger UI with logo
|
| 210 |
@app.get("/docs", include_in_schema=False)
|
|
|
|
| 1248 |
logger.info("🤗 VALIDATING HUGGINGFACE DATASETS...")
|
| 1249 |
logger.info("-" * 80)
|
| 1250 |
|
| 1251 |
+
# Check a sample of critical datasets (using new consolidated datasets)
|
| 1252 |
import requests
|
|
|
|
| 1253 |
|
| 1254 |
test_datasets = [
|
| 1255 |
+
("https://huggingface.co/datasets/CommunityOne/one-bills/resolve/main/data/train-00000-of-00001.parquet", "Bills (Consolidated)"),
|
| 1256 |
+
("https://huggingface.co/datasets/CommunityOne/one-local-officials/resolve/main/data/train-00000-of-00001.parquet", "Local Officials (Consolidated)"),
|
| 1257 |
+
("https://huggingface.co/datasets/CommunityOne/one-nonprofits-organizations/resolve/main/data/train-00000-of-00001.parquet", "Nonprofits (Consolidated)"),
|
| 1258 |
]
|
| 1259 |
|
| 1260 |
hf_datasets_ok = 0
|
| 1261 |
+
for url, display_name in test_datasets:
|
|
|
|
| 1262 |
try:
|
| 1263 |
response = requests.head(url, timeout=10, allow_redirects=True)
|
| 1264 |
if response.status_code == 200:
|