Spaces:
Runtime error
Runtime error
fix url
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from analyze import get_column_description, get_columns_with_strings, presidio_s
|
|
| 12 |
def stream_rows() -> Iterable[dict[str, Any]]:
|
| 13 |
batch_size = 100
|
| 14 |
for i in count():
|
| 15 |
-
rows_resp = requests.get(f"https://
|
| 16 |
if "error" in rows_resp:
|
| 17 |
raise RuntimeError(rows_resp["error"])
|
| 18 |
if not rows_resp["rows"]:
|
|
@@ -21,7 +21,7 @@ def stream_rows() -> Iterable[dict[str, Any]]:
|
|
| 21 |
yield row_item["row"]
|
| 22 |
|
| 23 |
def analyze_dataset(dataset: str) -> pd.DataFrame:
|
| 24 |
-
info_resp = requests.get(f"https://
|
| 25 |
if "error" in info_resp:
|
| 26 |
yield "❌ " + info_resp["error"], pd.DataFrame()
|
| 27 |
return
|
|
|
|
| 12 |
def stream_rows() -> Iterable[dict[str, Any]]:
|
| 13 |
batch_size = 100
|
| 14 |
for i in count():
|
| 15 |
+
rows_resp = requests.get(f"https://datasets-server.huggingface.co/rows?dataset={dataset}&config={config}&split={split}&offset={i * batch_size}&length={batch_size}", timeout=20).json()
|
| 16 |
if "error" in rows_resp:
|
| 17 |
raise RuntimeError(rows_resp["error"])
|
| 18 |
if not rows_resp["rows"]:
|
|
|
|
| 21 |
yield row_item["row"]
|
| 22 |
|
| 23 |
def analyze_dataset(dataset: str) -> pd.DataFrame:
|
| 24 |
+
info_resp = requests.get(f"https://datasets-server.huggingface.co/info?dataset={dataset}", timeout=3).json()
|
| 25 |
if "error" in info_resp:
|
| 26 |
yield "❌ " + info_resp["error"], pd.DataFrame()
|
| 27 |
return
|