File size: 485 Bytes
2821160 396c164 2821160 351919b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from huggingface_hub import HfApi
def space_hardware() -> str:
repo_id = "yxmauw/chatbot"
api = HfApi()
runtime = api.get_space_runtime(repo_id=repo_id)
if runtime.hardware is None:
space_hardware = "cpu-basic"
else:
space_hardware = runtime.hardware
first_string = space_hardware.split("-")[0].upper()
second_string = space_hardware.split("-")[1]
space_hardware = " ".join([first_string, second_string])
return space_hardware
|