Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 356 Bytes
d0f55c6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import httpx
from huggingface_hub import hf_hub_url
client = httpx.AsyncClient()
async def load_file(path):
url = to_url(path)
r = await client.get(url)
return r.json()
def to_url(path):
_, org_name, ds_name, filename = path.split("/", 3)
return hf_hub_url(repo_id=f"{org_name}/{ds_name}", filename=filename, repo_type="dataset")
|