Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Fix loading Details with documents containing end of lines
Browse files- src/hub.py +3 -1
src/hub.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import json
|
| 2 |
|
| 3 |
import httpx
|
|
@@ -17,7 +18,8 @@ async def load_file(path):
|
|
| 17 |
async def load_details_file(path):
|
| 18 |
url = to_url(path)
|
| 19 |
r = await client.get(url, headers=build_hf_headers())
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
def to_url(path):
|
|
|
|
| 1 |
+
import io
|
| 2 |
import json
|
| 3 |
|
| 4 |
import httpx
|
|
|
|
| 18 |
async def load_details_file(path):
|
| 19 |
url = to_url(path)
|
| 20 |
r = await client.get(url, headers=build_hf_headers())
|
| 21 |
+
f = io.StringIO(r.text)
|
| 22 |
+
return [json.loads(line) for line in f]
|
| 23 |
|
| 24 |
|
| 25 |
def to_url(path):
|