Spaces:
Sleeping
Sleeping
| __all__ = ['iface', 'size'] | |
| import gradio as gr | |
| from fastcore.net import urljson, HTTPError | |
| def size(repo:str): | |
| "Returns the size in GB of a HuggingFace Model Repo." | |
| url = f'https://huggingface.co/api/models/{repo}' | |
| try: | |
| resp = urljson(f'{url}/treesize/main') | |
| gb = resp['size'] / 1e9 | |
| return f'{gb:.2f} GB' | |
| except HTTPError: | |
| return f'Did not find repo: {url}' | |
| iface = gr.Interface(fn=size, inputs=gr.Text(value="Qwen/Qwen2.5-Coder-32B-Instruct"), outputs="text") | |
| iface.launch(height=450, width=500) |