Commit Graph

7 Commits

Author SHA1 Message Date
Hao Feng
0c99adc7dc
Update README.md 2025-06-23 00:36:16 +08:00
Hao Feng
cb1c409cea
Merge pull request #66 from Ivan-Inby/bugfix/fallback-to-cpu-if-no-cuda
fix: fallback to CPU when CUDA is not available
2025-06-15 22:05:53 +08:00
Ivan
3b86dc6254
fix: fallback to CPU when CUDA is not available
Previously, the code unconditionally attempted to move the model to the CUDA device (`self.model.to("cuda")`), which caused a runtime crash on systems where CUDA is not available (e.g., Apple M1/M2 or CPU-only environments). This resulted in the error:

AssertionError: Torch not compiled with CUDA enabled

The fix introduces a dynamic device selection:

    device = "cuda" if torch.cuda.is_available() else "cpu"
    self.model.to(device)

This change ensures compatibility across platforms and prevents crashes due to unavailable CUDA devices.
2025-06-15 13:52:42 +04:00
Hao Feng
8ac1495de8
Update README.md 2025-06-13 19:26:22 +08:00
Hao Feng
2a6fcb51c8
Update README.md 2025-06-13 17:01:01 +08:00
fenghao.2019
10b017a62b add pdf parsing 2025-06-13 16:45:28 +08:00
fenghao.2019
49f51871c6 [init] initial commit 2025-05-26 23:20:51 +08:00