jonatasgrosman / huggingsound

HuggingSound: A toolkit for speech-related tasks based on Hugging Face's tools
MIT License
430 stars 42 forks source link

Solve use_amp compatability issue #58

Closed nkaenzig closed 2 years ago

nkaenzig commented 2 years ago

transformers changed the name of the Trainer property use_amp to use_cuda_amp in this PR: https://github.com/huggingface/transformers/pull/17138

As for now, calling the function finetune() with e.g. with transformers==4.21.1 yields the following error:

AttributeError: 'CTCTrainer' object has no attribute 'use_amp'

This PR aims to support both naming conventions and thus support both older and more recent versions of the transformers library

Closes #45

jonatasgrosman commented 2 years ago

Thanks, @nkaenzig, for your contribution :) And sorry for the delayed response