Skip to content

make it possible to run in cpu - #407

Open
shiyushu2019 wants to merge 1 commit into
CompVis:mainfrom
shiyushu2019:edit
Open

make it possible to run in cpu#407
shiyushu2019 wants to merge 1 commit into
CompVis:mainfrom
shiyushu2019:edit

Conversation

@shiyushu2019

Copy link
Copy Markdown

I passed "device=device" when instantiating BERTTokenizer in BERTEmbedder, allowing inference to be performed on the CPU.

In the original code, tokens will be moved to "device" after tokenized. Without this edit, tokens will be moved to GPU by default, which makes it impossible to run on the CPU when we need to do it (for example, when we have insufficient GPU memory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant