Spaces:
Sleeping
Sleeping
PERDYPTO commited on
Update pipeline.py
Browse files- pipeline.py +2 -18
pipeline.py
CHANGED
|
@@ -21,7 +21,7 @@ from concurrent.futures import ProcessPoolExecutor, as_completed
|
|
| 21 |
from queue import Empty
|
| 22 |
|
| 23 |
import orjson
|
| 24 |
-
from datasets import load_dataset, Features, Value, Sequence
|
| 25 |
from huggingface_hub import batch_bucket_files
|
| 26 |
from fastapi import FastAPI
|
| 27 |
from fastapi.responses import JSONResponse
|
|
@@ -414,23 +414,7 @@ def load_stream(cfg):
|
|
| 414 |
if cfg.get("languages"):
|
| 415 |
kwargs["languages"] = cfg["languages"]
|
| 416 |
|
| 417 |
-
|
| 418 |
-
if cfg["dataset"] == "tokyotech-llm/swallow-code-v2":
|
| 419 |
-
# Define features to handle the mixed-type lint_report field
|
| 420 |
-
features = Features({
|
| 421 |
-
"text": Value("string"),
|
| 422 |
-
"repo_name": Value("string"),
|
| 423 |
-
"path": Value("string"),
|
| 424 |
-
"license": Value("string"),
|
| 425 |
-
"lint_report": Sequence(Struct({
|
| 426 |
-
"type": Value("string"),
|
| 427 |
-
"message": Value("string")
|
| 428 |
-
})),
|
| 429 |
-
})
|
| 430 |
-
kwargs["features"] = features
|
| 431 |
-
# Remove config name to avoid conflict
|
| 432 |
-
if "name" in kwargs:
|
| 433 |
-
del kwargs["name"]
|
| 434 |
return load_dataset(cfg["dataset"], **kwargs)
|
| 435 |
|
| 436 |
# ============================================================
|
|
|
|
| 21 |
from queue import Empty
|
| 22 |
|
| 23 |
import orjson
|
| 24 |
+
from datasets import load_dataset, Features, Value, Sequence
|
| 25 |
from huggingface_hub import batch_bucket_files
|
| 26 |
from fastapi import FastAPI
|
| 27 |
from fastapi.responses import JSONResponse
|
|
|
|
| 414 |
if cfg.get("languages"):
|
| 415 |
kwargs["languages"] = cfg["languages"]
|
| 416 |
|
| 417 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
return load_dataset(cfg["dataset"], **kwargs)
|
| 419 |
|
| 420 |
# ============================================================
|