fix: Remove global state (#1216)

* Remove all global settings state

* chore: remove autogenerated class

* chore: cleanup

* chore: merge conflicts
This commit is contained in:
Pablo Orgaz
2023-11-12 22:20:36 +01:00
committed by GitHub
parent f394ca61bb
commit 022bd718e3
24 changed files with 286 additions and 190 deletions

View File

@@ -4,7 +4,7 @@ from llama_index.llms.base import LLM
from llama_index.llms.llama_utils import completion_to_prompt, messages_to_prompt
from private_gpt.paths import models_path
from private_gpt.settings.settings import settings
from private_gpt.settings.settings import Settings
@singleton
@@ -12,7 +12,7 @@ class LLMComponent:
llm: LLM
@inject
def __init__(self) -> None:
def __init__(self, settings: Settings) -> None:
match settings.llm.mode:
case "local":
from llama_index.llms import LlamaCPP