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=greet, inputs="text", outputs="text") iface.launch()