Byaidu / PDFMathTranslate

PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/Docker
https://www.pdf2zh.com/
GNU Affero General Public License v3.0
2.8k stars 198 forks source link

feat (ai, model): automatically select GPU or CPU #66

Closed reycn closed 3 days ago

reycn commented 3 days ago

Description

This PR supports automatic device selection supported by pytorch.

Related Issue

Test

Test passed on RTX3080, using the following environment: conda create -n pdf python=3.11 pytorch torchvision transformers ipywidgets ipykernel -y -c nvidia -c conda-forge