TheoLvs commited on
Commit
7bbe839
·
verified ·
1 Parent(s): 1be33e0

Update tasks/text.py

Browse files
Files changed (1) hide show
  1. tasks/text.py +5 -6
tasks/text.py CHANGED
@@ -55,15 +55,14 @@ async def evaluate_text(request: TextEvaluationRequest):
55
  username, space_url = get_space_info()
56
 
57
  # Load and prepare the dataset
58
- dataset = load_dataset(request.dataset_name)
59
 
60
- # Convert dataset labels to integers based on LABEL_MAPPING
61
  dataset = dataset.map(lambda x: {"label": LABEL_MAPPING[x["label"]]})
62
 
63
- # Split dataset into train and test
64
- train_test = dataset["train"].train_test_split(test_size=request.test_size, seed=request.test_seed)
65
- test_dataset = train_test["test"]
66
-
67
  # Start tracking emissions
68
  tracker.start()
69
  tracker.start_task("inference")
 
55
  username, space_url = get_space_info()
56
 
57
  # Load and prepare the dataset
58
+ dataset = load_dataset(request.dataset_name, token=os.getenv("HF_TOKEN"))
59
 
60
+ # Convert string labels to integers
61
  dataset = dataset.map(lambda x: {"label": LABEL_MAPPING[x["label"]]})
62
 
63
+ # Split dataset
64
+ test_dataset = dataset["test"]
65
+
 
66
  # Start tracking emissions
67
  tracker.start()
68
  tracker.start_task("inference")