Closed XZF0 closed 4 months ago
Hi,
I haven't tried running on CPU since this new part in "language_model.py" was added. I think it should be easy to fix, but I'm little busy for next couple of days. Can you actually give it a try? We have to provide the argument device
there explicitly I think.
(If not you can also use SynCode as logit processor in example here (https://github.com/uiuc-focal-lab/syncode/blob/main/notebooks/example_logits_processor.ipynb), this would avoid all this and rely on HuggingFace generation method)
Sure.
So this is a method in the HF transformers utils. It wanted device as string.
Which in that context is available in self.device
.
Strange (and looks pretty hacky) that it is not pulled from the config. Perhaps there is a good reason?
Changing line 154 in language_model.py
logit_warper = self.model._get_logits_warper(gen_config, self.device)
Yes, it seems they changes the function argument device
to be required positional argument here in this commit.
Can you create a short PR with this change?
If we pass the argument explicitly then it will probably crash on old versions of transformers library. We will also need to update requirements.txt
to have transformers >=
certain version.
(Looks extremely interesting - really looking forward to trying it out :)
On an M1 Mac, no CUDA GPU, setting 'device'='cpu':