explosion / spacy-stanza

💥 Use the latest Stanza (StanfordNLP) research models directly in spaCy
MIT License
723 stars 59 forks source link

Specify GPU to use #45

Closed AlexeySlvv closed 4 years ago

AlexeySlvv commented 4 years ago

I have a system with two GPUs and create pipes with this code

pipe = stanza.Pipeline(lang=lang, use_gpu=True)

Is there any way to specify what GPU should pipes use? Maybe option like device="cuda:0"?

adrianeboyd commented 4 years ago

Hi, this is more of a stanza question than a spacy-stanza question. But I think you typically manage this through torch. It looks like you can probably control it with CUDA_VISIBLE_DEVICES or by importing torch and using its methods to select the device.

AlexeySlvv commented 4 years ago

Thanks. Moreover, this question has been already asked and solved.

https://github.com/stanfordnlp/stanza/issues/164