TheoLvs commited on
Commit
6692384
·
verified ·
1 Parent(s): 78ba4c7

Update tasks/text.py

Browse files
Files changed (1) hide show
  1. tasks/text.py +11 -2
tasks/text.py CHANGED
@@ -57,8 +57,17 @@ async def evaluate_text(request: TextEvaluationRequest,
57
  # Get space info
58
  username, space_url = get_space_info()
59
 
60
- # Load the dataset
61
- test_dataset = TextDataLoader(request, light=light_dataset).get_test_dataset()
 
 
 
 
 
 
 
 
 
62
 
63
  # Start tracking emissions
64
  if track_emissions:
 
57
  # Get space info
58
  username, space_url = get_space_info()
59
 
60
+ # Load and prepare the dataset
61
+ dataset = load_dataset(request.dataset_name, token=os.getenv("HF_TOKEN"))
62
+
63
+ # Convert string labels to integers
64
+ dataset = dataset.map(lambda x: {"label": LABEL_MAPPING[x["label"]]})
65
+
66
+ # Split dataset
67
+ test_dataset = dataset["test"]
68
+
69
+ track_emissions = True
70
+
71
 
72
  # Start tracking emissions
73
  if track_emissions: