Cyberbolt / Cemotion

A Chinese NLP library based on BERT for sentiment analysis and general-purpose Chinese word segmentation. | 基于 BERT 的中文 NLP 库,用于中文情感倾向分析、通用领域中文分词。
MIT License
187 stars 22 forks source link

how to use GPU #6

Closed limulimu closed 1 year ago

limulimu commented 1 year ago

我把torch替换为了CUDA版本的,但是就无法运行了 RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper_CUDA__index_select)

CPU版本太慢了,能麻烦指导一下吗

Cyberbolt commented 1 year ago

模型是在苹果 M1 上训练的,为了兼容性只保留了 CPU 推理

Cyberbolt commented 11 months ago

已更新,现在会自动识别并调用 NVIDIA 和 Apple Silicon GPUs