Read GGUF metadata (#3873)
This commit is contained in:
parent
39f4800d94
commit
9331ab4798
8 changed files with 154 additions and 52 deletions
|
@ -18,9 +18,9 @@ from transformers import (
|
|||
)
|
||||
|
||||
import modules.shared as shared
|
||||
from modules import llama_attn_hijack, RoPE, sampler_hijack
|
||||
from modules import RoPE, llama_attn_hijack, sampler_hijack
|
||||
from modules.logging_colors import logger
|
||||
from modules.models_settings import infer_loader
|
||||
from modules.models_settings import get_model_metadata
|
||||
|
||||
transformers.logging.set_verbosity_error()
|
||||
|
||||
|
@ -62,15 +62,11 @@ def load_model(model_name, loader=None):
|
|||
'ctransformers': ctransformers_loader,
|
||||
}
|
||||
|
||||
p = Path(model_name)
|
||||
if p.exists():
|
||||
model_name = p.parts[-1]
|
||||
|
||||
if loader is None:
|
||||
if shared.args.loader is not None:
|
||||
loader = shared.args.loader
|
||||
else:
|
||||
loader = infer_loader(model_name)
|
||||
loader = get_model_metadata(model_name)['loader']
|
||||
if loader is None:
|
||||
logger.error('The path to the model does not exist. Exiting.')
|
||||
return None, None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue