Spaces:
Running
Running
#!/usr/bin/env python3 | |
""" | |
Pre-deployment checklist for HF Space | |
""" | |
import os | |
import sys | |
from pathlib import Path | |
def check_deployment_ready(): | |
"""Check if everything is ready for HF deployment""" | |
print("π Pre-deployment checklist:\n") | |
checks = [] | |
# Check files exist | |
required_files = [ | |
"app.py", | |
"run_evaluation.py", | |
"requirements.txt", | |
".env.example", | |
"run_hf_space.py", | |
"official_config.yaml" | |
] | |
for file in required_files: | |
if Path(file).exists(): | |
checks.append((f"β {file} exists", True)) | |
else: | |
checks.append((f"β {file} missing", False)) | |
# Check API directories | |
if Path("apis").is_dir() and list(Path("apis").glob("*.py")): | |
checks.append(("β APIs directory configured", True)) | |
else: | |
checks.append(("β APIs directory missing or empty", False)) | |
# Check benchmarks directory | |
if Path("benchmarks").is_dir() and Path("benchmarks/gpqa_benchmark.py").exists(): | |
checks.append(("β GPQA benchmark implementation found", True)) | |
else: | |
checks.append(("β GPQA benchmark missing", False)) | |
# Check for sensitive data | |
if Path(".env").exists(): | |
checks.append(("β οΈ .env file exists - make sure it's in .gitignore!", None)) | |
# Print results | |
for check, status in checks: | |
print(check) | |
all_good = all(status is not False for _, status in checks) | |
if all_good: | |
print("\nβ Ready for deployment!") | |
print("\nNext steps:") | |
print("1. Set GROK_API_KEY and HF_TOKEN in HF Space secrets") | |
print("2. Make sure you have GPQA dataset access") | |
print("3. Push to Hugging Face") | |
else: | |
print("\nβ Issues found - please fix before deploying") | |
return all_good | |
if __name__ == "__main__": | |
check_deployment_ready() | |