mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
upgraded
This commit is contained in:
parent
c97ce2e736
commit
352caf44f4
@ -176,7 +176,7 @@ class LLMBinding:
|
||||
def reference_model(self, path):
|
||||
path = Path(str(path).replace("\\","/"))
|
||||
model_name = path.stem+".reference"
|
||||
folder_path = self.searchModelFolder(model_name)/path.stem
|
||||
folder_path = self.searchModelFolder(model_name)/(path.stem if path.suffix.lower()=="gguf" else path.name)
|
||||
model_full_path = (folder_path / model_name)
|
||||
|
||||
# Check if file already exists in folder
|
||||
|
@ -14,7 +14,7 @@ from lollms.server.elf_server import LOLLMSElfServer
|
||||
from lollms.binding import BindingBuilder, InstallOption
|
||||
from ascii_colors import ASCIIColors
|
||||
from lollms.utilities import load_config, trace_exception, gc
|
||||
from lollms.security import sanitize_path_from_endpoint, sanitize_path
|
||||
from lollms.security import sanitize_path_from_endpoint, sanitize_path, check_access
|
||||
from lollms.security import check_access
|
||||
from pathlib import Path
|
||||
from typing import List, Any
|
||||
@ -29,6 +29,7 @@ class ReloadBindingParams(BaseModel):
|
||||
binding_name: str = Field(..., min_length=1, max_length=50)
|
||||
|
||||
class BindingInstallParams(BaseModel):
|
||||
client_id: str
|
||||
name: str = Field(..., min_length=1, max_length=50)
|
||||
|
||||
|
||||
@ -132,6 +133,7 @@ def install_binding(data:BindingInstallParams):
|
||||
Returns:
|
||||
dict: Status of operation.
|
||||
"""
|
||||
check_access(lollmsElfServer, data.client_id)
|
||||
sanitize_path_from_endpoint(data.name)
|
||||
|
||||
ASCIIColors.info(f"- Reinstalling binding {data.name}...")
|
||||
@ -160,6 +162,7 @@ def reinstall_binding(data:BindingInstallParams):
|
||||
Returns:
|
||||
dict: Status of operation.
|
||||
"""
|
||||
check_access(lollmsElfServer, data.client_id)
|
||||
ASCIIColors.info(f"- Reinstalling binding {data.name}...")
|
||||
try:
|
||||
ASCIIColors.info("Unmounting binding and model")
|
||||
@ -191,6 +194,7 @@ def unInstall_binding(data:BindingInstallParams):
|
||||
Returns:
|
||||
dict: Status of operation.
|
||||
"""
|
||||
check_access(lollmsElfServer, data.client_id)
|
||||
ASCIIColors.info(f"- Reinstalling binding {data.name}...")
|
||||
try:
|
||||
ASCIIColors.info("Unmounting binding and model")
|
||||
|
Loading…
Reference in New Issue
Block a user