ProfillyBot / scripts /check_space.py
MinhDS's picture
Deploy ProfillyBot: Gradio ZeroGPU + CV RAG (Qwen2.5-3B)
32f26e4 verified
Raw
History Blame Contribute Delete
897 Bytes
"""Check Space status / try to pull error details."""
import os
import sys
from huggingface_hub import HfApi
def main() -> int:
token = os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACE_HUB_TOKEN")
api = HfApi(token=token)
info = api.space_info("MinhDS/ProfillyBot")
rt = info.runtime
print("stage:", rt.stage)
print("hardware:", rt.hardware)
print("requested:", rt.requested_hardware)
print("raw:", rt.raw)
# List top-level files
files = sorted({s.rfilename.split("/")[0] for s in info.siblings})
print("top-level:", files)
# Check for common issues: Dockerfile conflicting with Gradio SDK
names = {s.rfilename for s in info.siblings}
for f in ("Dockerfile", "Dockerfile.app", "app.py", "gradio_app.py", "requirements.txt"):
print(f"has {f}:", f in names)
return 0
if __name__ == "__main__":
raise SystemExit(main())