save
Browse files- app.py +9 -2
- requirements.txt +0 -0
app.py
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastcore.net import urljson, HTTPError
|
3 |
|
4 |
+
|
5 |
+
|
6 |
+
def size(repo):
|
7 |
+
url = f'https://huggingface.co/api/datasets/{repo}'
|
8 |
+
try: resp = urljson(f'{url}/treesize/main')
|
9 |
+
except HTTPError: return f'Did not find repo: {url}'
|
10 |
+
gb = resp['size'] / 1e9
|
11 |
+
return f'{gb:.2f} GB'
|
12 |
|
13 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
14 |
iface.launch()
|
requirements.txt
ADDED
File without changes
|