File size: 897 Bytes
32f26e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""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())