Spaces:
Sleeping
Sleeping
fix dataset loading
Browse files- tasks/text.py +4 -2
tasks/text.py
CHANGED
@@ -124,11 +124,13 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
124 |
}
|
125 |
|
126 |
try:
|
127 |
-
# Load and prepare the dataset
|
128 |
-
dataset = load_dataset(
|
129 |
|
130 |
# Convert string labels to integers
|
131 |
dataset = dataset.map(lambda x: {"label": LABEL_MAPPING[x["label"]]})
|
|
|
|
|
132 |
test_dataset = dataset["test"]
|
133 |
|
134 |
# Start tracking emissions
|
|
|
124 |
}
|
125 |
|
126 |
try:
|
127 |
+
# Load and prepare the dataset using the dataset name from the request
|
128 |
+
dataset = load_dataset(request.dataset_name)
|
129 |
|
130 |
# Convert string labels to integers
|
131 |
dataset = dataset.map(lambda x: {"label": LABEL_MAPPING[x["label"]]})
|
132 |
+
|
133 |
+
# Split dataset according to request parameters
|
134 |
test_dataset = dataset["test"]
|
135 |
|
136 |
# Start tracking emissions
|