Skip to content

bug w/ hf_load_dataset #25

@DataStrategist

Description

@DataStrategist

Hi all! I'm Amit from R4ds :)

Anyway, was giving this repo a go, and trying to run the example on the readme, and hitting this bug:

> emotion <- hf_load_dataset(  "emotion",
+   split = "test",
+   as_tibble = TRUE,
+   label_name = "int2str"
+ )
Using custom data configuration default
Reusing dataset emotion (C:\Users\mexin\.cache\huggingface\datasets\emotion\default\0.0.0\348f63ca8e27b3713b6c04d723efe6d824a56fb3d1449794716c0f0296072705)
100%|██████████| 3/3 [00:00<00:00, 600.13it/s]
Using custom data configuration default
Reusing dataset emotion (C:\Users\mexin\.cache\huggingface\datasets\emotion\default\0.0.0\348f63ca8e27b3713b6c04d723efe6d824a56fb3d1449794716c0f0296072705)
Error in as.integer(hf_data$label) : 
  cannot coerce type 'environment' to vector of type 'integer'

Chased the error to here:

hf_data <- tibble::tibble(reticulate::py$load_dataset("emotion", split = split)$to_pandas())
. However, restarting session cleared it right up. Maybe first-time use pains? Will continue to monitor it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions