File size: 420 Bytes
b17b1f0 3a821ed b17b1f0 3a821ed b17b1f0 f168c73 b17b1f0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import gradio as gr
from fastcore.net import urljson, HTTPError
def size(repo):
url = f'https://huggingface.co/api/datasets/{repo}'
try: resp = urljson(f'{url}/treesize/main')
except HTTPError: return f'Did not find repo: {url}'
gb = resp['size'] / 1e9
return f'{gb:.2f} GB'
iface = gr.Interface(fn=size, inputs=gr.Text(value="tglcourse/CelebA-faces-cropped-128"), outputs="text")
iface.launch() |