Create alternative requirements.txt with AMD and Metal wheels (#4052)

This commit is contained in:
oobabooga 2023-09-24 09:58:29 -03:00 committed by GitHub
parent 9de2dfa887
commit 2e7b6b0014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 336 additions and 66 deletions

View file

@ -9,19 +9,19 @@ from modules.callbacks import Iteratorize
from modules.logging_colors import logger
from modules.text_generation import get_max_prompt_length
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