chatbot / config.py
yxmauw's picture
Update config.py
351919b
raw
history blame
485 Bytes
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