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

@ -7,10 +7,7 @@ from modules import shared
from modules.chat import generate_chat_reply
from modules.LoRA import add_lora_to_model
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,
generate_reply,
@ -132,7 +129,7 @@ class Handler(BaseHTTPRequestHandler):
shared.model_name = model_name
unload_model()
model_settings = get_model_settings_from_yamls(shared.model_name)
model_settings = get_model_metadata(shared.model_name)
shared.settings.update(model_settings)
update_model_parameters(model_settings, initial=True)

View file

@ -1,11 +1,9 @@
from modules import shared
from modules.utils import get_available_models
from modules.models import load_model, unload_model
from modules.models_settings import (get_model_settings_from_yamls,
update_model_parameters)
from extensions.openai.embeddings import get_embeddings_model_name
from extensions.openai.errors import *
from modules import shared
from modules.models import load_model, unload_model
from modules.models_settings import get_model_metadata, update_model_parameters
from modules.utils import get_available_models
def get_current_model_list() -> list:
@ -33,7 +31,7 @@ def load_model(model_name: str) -> dict:
shared.model_name = model_name
unload_model()
model_settings = get_model_settings_from_yamls(shared.model_name)
model_settings = get_model_metadata(shared.model_name)
shared.settings.update(model_settings)
update_model_parameters(model_settings, initial=True)