Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning a nested DatasetsViews raises an AttributeError #47

Open
chschroeder opened this issue Sep 2, 2023 · 0 comments
Open

Cloning a nested DatasetsViews raises an AttributeError #47

chschroeder opened this issue Sep 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chschroeder
Copy link
Contributor

Bug description

Calling clone() on a nested dataset view raises the following error:

[...]
  File "/path/to/site-packages/small_text/active_learner.py", line 389, in _retrain
    dataset = self.dataset[self.indices_labeled].clone()
  File "/path/tob-v2-ifn6Asey/lib/python3.8/site-packages/small_text/integrations/transformers/datasets.py", line 32, in clone
    target_labels = None if self.dataset.track_target_labels else np.copy(self.target_labels)
AttributeError: 'TransformersDatasetView' object has no attribute 'track_target_labels'

The fix is easy, but this is also a sign that the "target label tracking" is not properly mapped to the dataset views.

Maybe the target tracking functionality was also never needed in the first place.

Steps to reproduce

Create a DatasetView of a DataSetView of a DataSet, then call .clone() (the outermost) view.

Expected behavior

--

Environment:

small-text integrations (e.g., transformers): pytorch, transformers

Addition information


@chschroeder chschroeder added the bug Something isn't working label Sep 2, 2023
@chschroeder chschroeder added this to the small-text-2.0.0 milestone Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant