You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The setfit multiclass example (examples/examplecode/setfit_multiclass_classification) fails on an installation with recent dependencies:
Traceback (most recent call last):
File "/home/cschroeder/.pyenv/versions/3.9.18/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/cschroeder/.pyenv/versions/3.9.18/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/cschroeder/workspaces/small-text/examples/examplecode/setfit_multiclass_classification.py", line 106, in <module>
main(num_iterations=args.num_iterations)
File "/home/cschroeder/workspaces/small-text/examples/examplecode/setfit_multiclass_classification.py", line 51, in main
indices_labeled = initialize_active_learner(active_learner, train.y)
File "/home/cschroeder/workspaces/small-text/examples/examplecode/setfit_multiclass_classification.py", line 84, in initialize_active_learner
active_learner.initialize(indices_initial)
File "/home/cschroeder/.pyenv/versions/small-text-3.9/lib/python3.9/site-packages/small_text/active_learner.py", line 154, in initialize
self._retrain(indices_validation=indices_validation)
File "/home/cschroeder/.pyenv/versions/small-text-3.9/lib/python3.9/site-packages/small_text/active_learner.py", line 404, in _retrain
self._clf.fit(dataset, **self.fit_kwargs)
File "/home/cschroeder/.pyenv/versions/small-text-3.9/lib/python3.9/site-packages/small_text/integrations/transformers/classifiers/setfit.py", line 246, in fit
return self._fit(sub_train, sub_valid, setfit_train_kwargs)
File "/home/cschroeder/.pyenv/versions/small-text-3.9/lib/python3.9/site-packages/small_text/integrations/transformers/classifiers/setfit.py", line 261, in _fit
seed = np.random.randint(np.iinfo(int_dtype()).max)
File "numpy/random/mtrand.pyx", line 798, in numpy.random.mtrand.RandomState.randint
File "numpy/random/_bounded_integers.pyx", line 1332, in numpy.random._bounded_integers._rand_int64
ValueError: high is out of bounds for int64
Bug description
The setfit multiclass example (
examples/examplecode/setfit_multiclass_classification
) fails on an installation with recent dependencies:Downgrading numpy solves this.
Environment:
Python version: 3.9
small-text version: 2.0.0.dev1
small-text integrations (e.g., transformers):
PyTorch version (if applicable): 2.5.1
numpy: >2.0.0
The text was updated successfully, but these errors were encountered: