Create alternative requirements.txt with AMD and Metal wheels (#4052)
This commit is contained in:
parent
9de2dfa887
commit
2e7b6b0014
13 changed files with 336 additions and 66 deletions
|
@ -10,19 +10,19 @@ from transformers.modeling_outputs import CausalLMOutputWithPast
|
|||
from modules import RoPE, shared
|
||||
from modules.logging_colors import logger
|
||||
|
||||
import llama_cpp
|
||||
try:
|
||||
import llama_cpp
|
||||
except:
|
||||
llama_cpp = None
|
||||
|
||||
if torch.cuda.is_available() and not torch.version.hip:
|
||||
try:
|
||||
import llama_cpp_cuda
|
||||
except:
|
||||
llama_cpp_cuda = None
|
||||
else:
|
||||
try:
|
||||
import llama_cpp_cuda
|
||||
except:
|
||||
llama_cpp_cuda = None
|
||||
|
||||
|
||||
def llama_cpp_lib():
|
||||
if shared.args.cpu or llama_cpp_cuda is None:
|
||||
if (shared.args.cpu and llama_cpp is not None) or llama_cpp_cuda is None:
|
||||
return llama_cpp
|
||||
else:
|
||||
return llama_cpp_cuda
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue