CouncilDataProject / speakerbox

Speakerbox: Fine-tune Audio Transformers for speaker identification.
https://councildataproject.org/speakerbox
MIT License
51 stars 6 forks source link

accelerate or tranformers[torch] required #25

Open gregoryfoster opened 10 months ago

gregoryfoster commented 10 months ago

Describe the Bug

After a small training run, the program halted with the following error indicating a required library was missing.

Expected Behavior

Completion of training.

Reproduction

pipenv install speakerbox==1.2.0 Execute script that calls speakerbox.train()

...
File "...code/transcribe/.venv/lib/python3.10/site-packages/speakerbox/main.py", line 265, in train
    args = TrainingArguments(
  File "<string>", line 117, in __init__
  File "...code/transcribe/.venv/lib/python3.10/site-packages/transformers/training_args.py", line 1442, in __post_init__
    and (self.device.type != "cuda")
  File "...code/transcribe/.venv/lib/python3.10/site-packages/transformers/training_args.py", line 1887, in device
    return self._setup_devices
  File "...code/transcribe/.venv/lib/python3.10/site-packages/transformers/utils/generic.py", line 54, in __get__
    cached = self.fget(obj)
  File "...code/transcribe/.venv/lib/python3.10/site-packages/transformers/training_args.py", line 1787, in _setup_devices
    raise ImportError(
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`

Environment

gregoryfoster commented 10 months ago

I'm not sure how you'd like to handle, as a workaround:

pipenv install "accelerate>=0.20.1"

evamaxfield commented 9 months ago

I think we just need to add accelerate to the library. Can you add that dep to the pyproject.toml and make a PR?