Read GGUF metadata (#3873)

This commit is contained in:
oobabooga 2023-09-11 18:49:30 -03:00 committed by GitHub
parent 39f4800d94
commit 9331ab4798
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 154 additions and 52 deletions

View file

@ -8,10 +8,7 @@ from tqdm import tqdm
from modules import shared
from modules.models import load_model, unload_model
from modules.models_settings import (
get_model_settings_from_yamls,
update_model_parameters
)
from modules.models_settings import get_model_metadata, update_model_parameters
from modules.text_generation import encode
@ -69,7 +66,7 @@ def calculate_perplexity(models, input_dataset, stride, _max_length):
if model != 'current model':
try:
yield cumulative_log + f"Loading {model}...\n\n"
model_settings = get_model_settings_from_yamls(model)
model_settings = get_model_metadata(model)
shared.settings.update(model_settings) # hijacking the interface defaults
update_model_parameters(model_settings) # hijacking the command-line arguments
shared.model_name = model