mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-12 16:19:42 +00:00
support npu
This commit is contained in:
parent
dd0e41b3b8
commit
7d51a13c9b
34 changed files with 14004 additions and 5626 deletions
|
@ -14,7 +14,15 @@ Copyright (c) 2024 by KVCache.AI, All Rights Reserved.
|
|||
import ctypes
|
||||
import torch
|
||||
from torch import Tensor, nn
|
||||
if not torch.xpu.is_available():
|
||||
|
||||
try:
|
||||
import torch_npu
|
||||
|
||||
use_torch_npu = torch_npu.npu.is_available()
|
||||
except:
|
||||
use_torch_npu = False
|
||||
|
||||
if not torch.xpu.is_available() and not use_torch_npu:
|
||||
import KTransformersOps
|
||||
import vLLMMarlin
|
||||
from ktransformers.util.custom_loader import GGUFLoader, SafeTensorLoader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue